$(".lx").scroll(function(){
var $this =$(this),
viewH =$(this).height(),//可见高度
contentH =$(this).get(0).scrollHeight,//内容高度
scrollTop =$(this).scrollTop();//滚动高度
if(scrollTop/(contentH -viewH)>=1){ //到达底部时,加载新内容
处理业务逻辑
}
});
jquery监听滚动条
最新推荐文章于 2022-11-06 08:13:21 发布