var lastId = 0;//记录每一次加载后的最后一条记录Id,跟你的排序有关
var isloading = false;
$(window).bind("scroll",function(){
if($(document).scrollTop() + $(window).height() > $(document) - 10 && !isloading){
isloading = true;
getMore();
}
});
function getMore(){
var url = "...";
$.getJSON(url,function(data){
var html="";
... ...
$(html).insertAfter($(".elem").last());
isloading = false;
});
}
jquery无限加载
最新推荐文章于 2023-12-22 09:07:02 发布