没有使用jquery的ajax的无限滚动?

我想在jquery移动web应用程序中创建无限滚动。我想在不使用ajax的情况下滚动页面。是否有可能这样做?

如果您的数据不是真的无限,您可以将所有内容存储在页面中并显示需要显示的内容。

例如(未经测试,但为了给你一个想法):

HTML

 

jQuery的

 var $doc=$(document); var $win=$(window); // hide everything that is out of bound $('.scrollable-data').filter(function(index){ return ($(this).scrollTop() > $doc.height()); }).hide(); var DATA_INCREMENT=5; $(window).scroll(function(){ // test if at the bottom if ($doc.height()-$win.height()-$(this).scrollTop() == 0) { // show the  (5) next hidden data tags $('.scrollable-data:hidden:lt('+DATA_INCREMENT+')').show(); } }); 

希望这可以帮助。