Skip to content

Instantly share code, notes, and snippets.

@marioblas
Created July 17, 2014 12:55
Show Gist options
  • Save marioblas/8af4cdf73cb30c2c2be4 to your computer and use it in GitHub Desktop.
Save marioblas/8af4cdf73cb30c2c2be4 to your computer and use it in GitHub Desktop.
jQuery - Check if a user has scrolled to the bottom
/**
* Check if a user has scrolled to the bottom.
*
* Source: http://stackoverflow.com/questions/3898130/how-to-check-if-a-user-has-scrolled-to-the-bottom
*/
$(window).scroll(function() {
if( $(window).scrollTop() + $(window).height() == $(document).height() ) {
console.log("bottom!");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment