Created
July 20, 2012 12:45
-
-
Save donohoe/3150544 to your computer and use it in GitHub Desktop.
Determine when you have scrolled to the end of an element
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
document.getElementById('items').addEventListener('scroll', function() { | |
var seekEl = document.getElementById("items"); | |
var contentHeight = seekEl.scrollHeight - seekEl.offsetHeight; | |
if (contentHeight <= seekEl.scrollTop) { | |
console.log("Scroll end"); | |
} | |
}, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment