Last active
September 10, 2018 08:06
-
-
Save kino6052/4dfe695e0e0c08b71889c5128cfcc6cb to your computer and use it in GitHub Desktop.
Determine if user scrolled all the way to the bottom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stackoverflow.com/questions/9439725/javascript-how-to-detect-if-browser-window-is-scrolled-to-bottom | |
window.onscroll = function(ev) { | |
if ((window.innerHeight + window.pageYOffset) >= document.body.offsetHeight) { | |
alert("you're at the bottom of the page"); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment