//20是可以更改的,是距离页面底部的高度,触发ajax事件
$(window).bind("scroll",function() {
if ($(document).scrollTop() + $(window).height() > $(document).height() - 20) {
$.ajax({
url:'‘,
type:'post',
success:function(data){
//成功后将元素添加到页面
}
})
//其他操作
}
})
|