Skip to content

Instantly share code, notes, and snippets.

@adam-acosta
Created July 30, 2018 02:14
Show Gist options
  • Select an option

  • Save adam-acosta/628783cff5d28703fc511a717dac528d to your computer and use it in GitHub Desktop.

Select an option

Save adam-acosta/628783cff5d28703fc511a717dac528d to your computer and use it in GitHub Desktop.

Revisions

  1. adam-acosta created this gist Jul 30, 2018.
    9 changes: 9 additions & 0 deletions autoscroll.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    var lastScrollHeight = 0;
    function autoScroll() {
    var sh = document.documentElement.scrollHeight;
    if (sh != lastScrollHeight) {
    lastScrollHeight = sh;
    document.documentElement.scrollTop = sh;
    }
    }
    window.setInterval(autoScroll, 100);