1. 瀑布流布局jquery特效代码怎么用
楼主您好
引入infinitescroll
页面元素
<div data-am-widget="list_news" class="am-list-news am-list-news-default" style="margin:0px 10px 0px 10px;">
<!--列表标题-->
<div class="am-list-news-bd">
<ul class="am-list block" id="container"></ul>
</div>
</div>
<div class="loading" style="text-align:center;">
</div>
<div id="navigation">
<a></a>
</div>
初始化
var navigationUrl = "xxxx?pageNo=1";
$("#navigation a").attr("href", navigationUrl);
$.ajax({
url: 'xxxx',
type: 'post',
dataType:'json',
success: function(items) {
var html = successCallBack(items);//渲染每一个瀑布流块
$('#container').html(html);
},
error: function() {
alert('加载失败');
}
});
初始化方法调用
$('#container').infinitescroll({
navSelector : "#navigation", //导航的选择器,会被隐藏
nextSelector : "#navigation a", //包含下一页链接的选择器
itemSelector : ".block", //你将要取回的选项(内容块)
debug : true, //启用调试信息
animate : true, //当有新数据加载进来的时候,页面是否有动画效果,默认没有
extraScrollPx : 150, //滚动条距离底部多少像素的时候开始加载,默认150
bufferPx : 40, //载入信息的显示时间,时间越大,载入信息显示时间越短
errorCallback : function() {
//alert('error');
}, //当出错的时候,比如404页面的时候执行的函数
localMode : true, //是否允许载入具有相同函数的页面,默认为false
dataType : 'json',//可以是json
template: function(items) {
itemsTemp = items;
return successCallBack(items);
},
loading : {
img: '${ctx}/images/loading.gif',
msgText : "加载中...",
finishedMsg : '没有新数据了...',
selector : '.loading' // 显示loading信息的div
}
}, function() {
});