- 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;
- })
- }
- }
- });