我有一个包含大量记录的表格,而不是对不同的页面进行分页,我希望能够向下滚动页面,并且要在表格中显示更多行,您滚动的记录越多,您看到的记录就越多。
类似于Twitter和Facebook如何工作,但对于表行。滚动条是浏览器上的默认滚动条?我认为它叫做无休止的滚动?
这可能吗?
答案 0 :(得分:2)
这是滚动调用加载
几个可以为您提供开始的链接
http://www.9lessons.info/2009/07/load-data-while-scroll-with-jquery-php.html
http://www.webresourcesdepot.com/load-content-while-scrolling-with-jquery/
http://thewebthought.blogspot.com/2012/01/jquery-loading-content-while-user.html
答案 1 :(得分:1)
var scroll = 0;
$(window).scroll(function () {
if (scroll > 0) {
if ($(window).height() + $(window).scrollTop() >= ($(document).height() - 50)) {
getTableItems(); /*call this function for getting table items from database*/
}
}
scroll++;
});
以上脚本将在滚动
上加载更多项目