Skip to content

Instantly share code, notes, and snippets.

@agamm
Created July 5, 2013 21:08
Show Gist options
  • Save agamm/5937255 to your computer and use it in GitHub Desktop.
Save agamm/5937255 to your computer and use it in GitHub Desktop.
Automatically scroll webpages (nice for reading online) Installation: Create a new bookmark, call it: "Autoscroll", and in the URL field enter the code below:
javascript: var x = 1 * prompt("Start From:", window.pageYOffset);var s = 1 * prompt("Speed:", 0.03);var time = document.createElement("div");time.style.position = "fixed";time.style.top = "90%";time.style.left = "90%";document.body.appendChild(time);if (x != null && s !== null) {window.setInterval(function () {if (x + window.innerHeight <= document.height) {x += s;document.body.scrollTop = x;time.innerHTML = ((document.height - (x + window.innerHeight)) / (s * 100)).toFixed(2) + "s";}}, 10);}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment