标签:style blog io ar java on div 2014 log
由于时间关系没有整理封装,有空的时候再把他做成一个插件。但复制下来修改一下是可以用的。以下为实例:
var p="{$other.p}";
if(p=="") p=1;
var stop=true;//触发开关,防止多次调用事件
$(window).scroll(function() {
//当内容滚动到底部时加载新的内容 100当距离最底部100个像素时开始加载.
if ($(this).scrollTop() + $(window).height() + 100 >= $(document).height() && $(this).scrollTop() > 100) {
if(stop==true){
stop=false;
p=p+1;//当前要加载的页码
canshu="?t={$other.t}&p="+p+"&cid={$other.cid}";
//加载提示信息
$("#showlists").append("<li class='ajaxtips'><div style='font-size:2em'>Loding.....</div></li>");
$.get("__URL__/nextpage"+canshu,function(data){
$(".ajaxtips").hide();
$("#showlists").append(data);//把新的内容加载到内容的后面
stop=true;
})
}
}
}); 标签:style blog io ar java on div 2014 log
原文地址:http://blog.csdn.net/yybjroam05/article/details/41351741