首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

当滚动条到最底部,自动加载页面,怎么实现,类似微博那种

2012-10-31 
当滚动条到最底部,自动加载页面,如何实现,类似微博那种当滚动条到最底部,自动加载页面,如何实现,类似微博

当滚动条到最底部,自动加载页面,如何实现,类似微博那种
当滚动条到最底部,自动加载页面,如何实现,类似微博那种

参考下面网站
http://www.dzone.com/links/index.html


[解决办法]
查看下源文件

HTML code
<script>    if(true){        jQuery(function(){           var m = window.location.search.match(/p=(\d+)/);           var curPage = m ? parseInt(m[1]) : 1;           var loading = false;           jQuery("#content").scroll(function(){               if ( curPage >= 1 && !loading && this.scrollHeight -                       this.scrollTop - this.offsetHeight < this.offsetHeight ) {                   loading = true;                   if ((25*curPage) < 79346) {                        DWRUtil.setValue("scrollStats", 25*(curPage+1) + " of " + 79346);                    } else {                        DWRUtil.setValue("scrollStats", 79346);                    }                   $("progressIndicator").style.display="block";                   jQuery.ajax({                       type: "GET",                       dataType: "html",                       url: window.location + (window.location.search != '' ? "&" : "?") + "type=html&p=" + ( ++curPage ),                       success: function( html ){                           html = jQuery.trim( html );                           if ( html ) {                               jQuery("#content-inner").append( html );                               //                             }                           } else                               curPage = 0;                       },                       complete: function(){                           loading = false;//                         alert(window.location.pathname + (window.location.search != '' ? ""+ window.location.search +"&" : "?") + "p=" + ( curPage ))                           pageTracker._trackPageview(window.location.pathname + (window.location.search != '' ? ""+ window.location.search +"&" : "?") + "p=" + ( curPage ));                           _qacct="p-ebK_XdQH1HeLo"; quantserve();                           $("progressIndicator").style.display="none";                       }                   });               }           });        });    }</script> 

热点排行