I need to detect if a user is scrolled to the bottom of a page. If they are at the bottom of the page, when I add new content to the bottom, I will automatically scroll them
Try this method if you've had no luck with the others.
window.onscroll = function() { var difference = document.documentElement.scrollHeight - window.innerHeight; var scrollposition = document.documentElement.scrollTop; if (difference - scrollposition <= 2) { alert("Bottom of Page!"); } }