Determining when scrolled to bottom of a page with Javascript
- by chimerical
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