Skip to content

Instantly share code, notes, and snippets.

@adam-acosta
Created July 30, 2018 02:14
Show Gist options
  • Save adam-acosta/628783cff5d28703fc511a717dac528d to your computer and use it in GitHub Desktop.
Save adam-acosta/628783cff5d28703fc511a717dac528d to your computer and use it in GitHub Desktop.
var lastScrollHeight = 0;
function autoScroll() {
var sh = document.documentElement.scrollHeight;
if (sh != lastScrollHeight) {
lastScrollHeight = sh;
document.documentElement.scrollTop = sh;
}
}
window.setInterval(autoScroll, 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment