Skip to content

Instantly share code, notes, and snippets.

@kino6052
Last active September 10, 2018 08:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kino6052/4dfe695e0e0c08b71889c5128cfcc6cb to your computer and use it in GitHub Desktop.
Save kino6052/4dfe695e0e0c08b71889c5128cfcc6cb to your computer and use it in GitHub Desktop.
Determine if user scrolled all the way to the bottom
// 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