3 ms·
Setting the scroll increment to 5px diminishes the lenticular effect; it's like skipping frames in film. Your mind interpolates the result, but it's not as smoo
by bradleyland 12y ago
Setting the scroll increment to 5px diminishes the lenticular effect; it's like skipping frames in film. Your mind interpolates the result, but it's not as smooth as scrolling by 1px and reducing the time interval to speed things up instead.
Try this one instead to see the difference. This will scroll at approximately the same rate as your example:
setInterval(function() { window.scrollTo(0, document.body.scrollTop + 1) }, 12);
I prefer it a bit slower though:
setInterval(function() { window.scrollTo(0, document.body.scrollTop + 1) }, 30);
- acangiano 12y agoNo need to use the console either. Just put bradleyland's suggestion in the address bar prefixed by javascript: javascript:setInterval(function() { window.scrollTo(0, document.body.scrollTop + 1) }, 30);
- geofft 12y agoI'm curious what browser you use. I was under the impression that most of the major browsers had disabled the ability to type javascript: URLs because of self-XSS (which is a fascinating concept on the border between computer exploit and human exploit). On Chrome 39 on CrOS, I can't type that into the URL field, and if I copy/paste it, the "javascript:" portion of the scheme magically disappears, so hitting enter takes me to a SERP. I wonder if that's done in the hope that you Google the self-XSS that you were about to run and see someone explain what's going on.
- gnosek 12y agoThe initial "javascript:" gets stripped on paste but you can add it back manually.