Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Detecting scroll to bottom of HTML page
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