此方法是根据下滑高度加一个值大于当前页面高度来判断的,所以使用时需要自行监测滑动高度和当前页的高度,修改800这个数值具体大小。
$(function() {
$(document).scroll(function() {
var scrollHeight = $(document).height();
console.log('当前高度:'+$(document).scrollTop(),'页面高度'+scrollHeight)
if ($(document).scrollTop()+800 >= scrollHeight) {
console.log('到底了~')
}
})
}) 如果帮助到你,请赏杯奶茶喝~
- 本文链接: https://www.shx1024.top//index/article/details/article_id/33.shtml
- 版权声明:本博客所有文章除特别声明外,均默认采用 许可协议。