seaJs 模块中的html怎么绑定后台数据显示
seajs如何绑定后台数据啊
jsp页面中加载了seajs
campus.js 如下
我要如何将card_1中的城市通过后台传过来的数据进行遍历输出啊?包括图片地址等。
jsp页面中加载了seajs
window.onload = function() {
seajs.use('campus', function(campus) {});
}
campus.js 如下
define(function(require, exports, module) {
var iCard = require('iCard');
var Acard = new iCard({
id: 'app',
maxDistance: 50,
firstEl: '.view-1',
secondEl: '.view-2',
thirdEl: '.view-3',
gotoDuration: 0.3,
endDuration: 0.3,
resetDuration: 0.1,
fliterClass: '.detail-con',
swipeDirection: 'v',
AnimateType: 'ZakerSlide',
gotoAnimateType: 'ZakerSlide'
});
var card_1 = {
id: 'card_1',
html: '<section class="scene-5 scene">\
<div class="bg5">\
<section class="mapStore">\
<div class="mapTit"><img src="imgs/mapStore/map_tit.png"></div>\
</section>\
<section id="picScroll" class="picScroll">\
<div class="hd">\
<ul></ul>\
</div>\
<div class="bd">\
<ul>\
<li><div><img src="imgs/mapStore/cities/city01.jpg" alt=""/></div><p>上海</p><p>SHANG HAI</p></li>\
<li><div><img src="imgs/mapStore/cities/city02.jpg" alt=""/></div><p>北京</p><p>BEI JING</p></li>\
<li><div><img src="imgs/mapStore/cities/city03.jpg" alt=""/></div><p>广州</p><p>GUANG ZHOU</p></li>\
<li><div><img src="imgs/mapStore/cities/city04.jpg" alt=""/></div><p>深圳</p><p>SHEN ZHEN</p></li>\
<li><div><img src="imgs/mapStore/cities/city05.jpg" alt=""/></div><p>苏州</p><p>SU ZHOU</p></li>\
<li><div><img src="imgs/mapStore/cities/city06.jpg" alt=""/></div><p>南京</p><p>NAN JING</p></li>\
</ul>\
<ul>\
<li><div><img src="imgs/mapStore/cities/city07.jpg" alt=""/></div><p>杭州</p><p>HANG ZHOU</p></li>\
<li><div><img src="imgs/mapStore/cities/city08.jpg" alt=""/></div><p>宁波</p><p>NING BO</p></li>\
<li><div><img src="imgs/mapStore/cities/city09.jpg" alt=""/></div><p>温州</p><p>WEN ZHOU</p></li>\
</ul>\
</div>\
<span class="triangle_left"><img src="imgs/mapStore/triangle_l.png"/></span>\
<span class="triangle_right"><img src="imgs/mapStore/triangle_r.png"/></span>\
</section>\
</div>\
<div class="triangle"><img src="imgs/mapStore/triangle.png"/></div>\
<div id="map">\
<span class="about_exit"></span>\
<img src="imgs/mapStore/map.jpg" alt="" style="width: 100%"/>\
</div>\
</section>',
onload: function(card) {
TouchSlide({
slideCell:"#picScroll",
titCell:".hd ul",
effect:"leftLoop",
autoPage:true,
switchLoad:"_src"
});
$(".bd li").tap(function(){
$("#map").show().addClass("fadeIn");
})
$(".about_exit").bind("tap",function(){
$("#map").addClass("fadeOut");
setTimeout(function() {
$("#map").hide().removeClass("fadeIn fadeOut");
}, 800);
})
$(".refer_popup,#map").bind("touchmove",function(e){
e.preventDefault();
e.stopPropagation();
});
},
onLeft: function(card) {
}
};
.....
window.Acard = Acard;
Acard.add(card_1).add(card_2).add(card_3).add(card_4).add(card_5).add(card_6).add(card_7).add(card_8).init('card_1');
我要如何将card_1中的城市通过后台传过来的数据进行遍历输出啊?包括图片地址等。
...全文
相关推荐
SeaJS入门教程系列之使用SeaJS(二)
下载后将其放入项目目录中,并在HTML文件中通过`<script>`标签引入。SeaJS的开发原则是“一切皆为模块”。
前端动态分页解决方案:Bootstrap与SeaJS分页插件实战
在本章节中,我们将深入探讨分页插件的自定义样式和事件监听功能。这不仅能让分页插件更好地融入现有的页面风格中,还能通过事件监听提供更加丰富的交互体验。自定义样式是前端开发中必不可少的一部分。为了使分页插件更加符合特定项目的设计需求,我们往往需要对其进行样式定制。
seajs和requirejs模块化简单案例分析
模块化在前端开发中扮演着重要的角色,它解决了传统JavaScript代码中的全局变量冲突问题和依赖管理的繁琐。
SeaJS入门教程系列之SeaJS介绍(一)
SeaJS的使用方法非常直观。开发者首先需要在HTML文件中引入SeaJS核心文件。然后,通过SeaJS提供的API(如`seajs.use`)来加载模块。
seajs源码阅读
Seajs的模块加载机制是基于`<script>`标签的动态插入。当调用`seajs.use`时,Seajs会生成一个`<script>`标签,并将其插入到HTML文档中,从而触发脚本的下载。


