Created
December 2, 2013 16:43
-
-
Save jq-87/7752407 to your computer and use it in GitHub Desktop.
Detect when scroll position is at the bottom of page
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
$(window).scroll(function(){ | |
var pageHeight = $(document).height(), | |
windowHeight = $(window).height(), | |
topDistance = $(document).scrollTop(); | |
if( pageHeight - topDistance == windowHeight) { | |
//load more content now | |
console.log('reached the bottom'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment