注意:本例中使用的数据来自本地站的文章:有一个介绍数据表的创建。 jQuery 1。首先,我们想获得浏览器的可视区域页面的高度。 复制代码代码如下:var = $(窗口)的调查。Height(); 2, then, when scrolling the page needs to be done is to calculate the total height of the page (when the scroll at the bottom of the new page page load data, so the total height is dynamic), calculation of the scroll position (scroll position is with the highly dynamic change of loading the page), then construct a formula the calculation of relative proportion.
$(窗口)。滚动(函数(){) 无功pageh = $(文档。体)(的高度); / /页面的总高度 无功scrollt = $(窗口),ScrollTop(上); / /滚动 VaR AA =(pageh调查scrollt) /调查; }); 3,当滚动条接近页面底部时,它会触发Ajax加载。在这种情况下,我们使用jQuery的getJSON方法发送请求到服务器result.php,和请求的参数页面,即页码。