1 var p="{$other.p}";
2 if(p=="") p=1;
3 var stop=true;//触发开关,防止多次调用事件
4 $(window).scroll(function() {
5 //当内容滚动到底部时加载新的内容 100当距离最底部100个像素时开始加载.
6 if ($(this).scrollTop() + $(window).height() + 100 >= $(document).height() && $(this).scrollTop() > 100) {
7
8 if(stop==true){
9 stop=false;
10 p=p+1;//当前要加载的页码
11 canshu="?t={$other.t}&p="+p+"&c;
12 //加载提示信息
13 $("#showlists").append("<li class='ajaxtips'><div >Loding.....</div></li>");
14 $.get("__URL__/nextpage"+canshu,function(data){
15 $(".ajaxtips").hide();
16 $("#showlists").append(data);//把新的内容加载到内容的后面
17 stop=true;
18 })
19 }
20 }
21 });