js滑动到页面底部实现加载更多
$(document).scroll(function(){ var bheight = $(document).height();//获取窗口高度 var sheight = $("body")[0].scrollHeight;//获取滚动条高度,[0]是为了把jq对象转化为js对象 var stop = $("body").scrollTop();//滚动条距离顶部的距离 if(stop>=sheight-bheight){//当滚动条到顶部的距离等于滚动条高度减去窗口高度时 ajaxQuery();//发送请求 } });
浙公网安备 33010602011771号