Skip to content

Instantly share code, notes, and snippets.

@heydona
Created November 8, 2012 19:04
Show Gist options
  • Save heydona/4040806 to your computer and use it in GitHub Desktop.
Save heydona/4040806 to your computer and use it in GitHub Desktop.
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