I'm trying to determine when I've scrolled to the bottom of the page (without using any JS library), but so far, I'm a bit confused over which one of the following to use. The most promising one I've seen is window.scrollY
, but even when scrolled to the bottom of the page, it never matches the value of window.innerHeight
. What's the best way to do this?
window.innerWidth
window.innerHeight
window.outerWidth
window.outerHeight
window.scrollX
window.scrollY
document.body.scrollWidth
document.body.scrollHeight
document.body.scrollTop
document.body.scrollLeft
document.body.offsetTop
document.body.offsetLeft
document.body.offsetWidth
document.body.offsetHeight
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…