滚动底部加载更多 - davy-gan/web GitHub Wiki
var stop=true;
$(window).scroll(function(){
var totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
if($(document).height() <= totalheight){
if(stop==true){
stop=false;
$.post("ajax.php", {start:1, n:50},function(txt){
$("#Loading").before(txt);
stop=true;
},"text");
}
}
});
<div id="Loading">Loading...</div>