Created
November 8, 2012 19:04
-
-
Save heydona/4040806 to your computer and use it in GitHub Desktop.
Detecting scroll to bottom of HTML 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
document.addEventListener("DOMContentLoaded", | |
window.addEventListener("scroll", | |
function() { | |
var b = document.body | |
if (b.clientHeight + b.scrollTop >= b.scrollHeight) { | |
// ... | |
} | |
}) | |
if (b.clientHeight >= b.scrollHeight) { | |
// ... | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment