版权声明:如需转载请参阅《转载说明》 https://blog.csdn.net/automation13/article/details/81674925
window.addEventListener('scroll', function(){
const scrollHeight = document.body.scrollHeight || document.documentElement.scrollHeight;
const clientHeight = document.body.clientHeight || document.documentElement.scrollHeight;
const scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
if(scrollTop >= scrollHeight - clientHeight){
console.log('页面滑动到底部')
}
})