源码:
$(window).scroll(function () {
var scrollTop = $(this).scrollTop()
var scrollHeight = $(document).height()
var windowHeight = $(this).height()
console.log(`scrollTop: ${scrollTop}`)
console.log(`windowHeight: ${windowHeight}`)
console.log(`scrollHeight: ${scrollHeight}`)
})
为啥当页面滚动到底部时, scrollTop + windowHeight
的总大小 [大于] scrollHeight
, 不是应该相等才对吗?
@yhhwpp 网上流传滚动到底部ajax加载条件不就是 scrollTop + windowHeight = scrollHeight么?