Last Updated: February 25, 2016
·
643
· agam360

Auto Scroller for reading in websites

(Chrome:) Ctrl+Shift+J
Paste:

var x = 0;
var s = 0.23;
window.setInterval(function(){
    if(x<=document.body.clientHeight){
        x+=s;
        document.body.scrollTop = x;
    }
},100);

Have fun reading (s= [0.2 - slow, 0.35 - normal, 0.5 fast])!

----UPDATE----<br />
I've updated the code to be more "user friendly",<br />
Create a book mark and add the following in the URL input field:<br />


javascript:var x =prompt("Start From:",window.pageYOffset );x=1x;var s    =prompt("Speed:",0.03);s=s1; window.setInterval(function(){ if(x<=document.body.clientHeight){ x+=s; document.body.scrollTop = x; } },10);
</code></pre>

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside