Re:Jankyscroll – a JavaScript library that doesn't need to e...
by rcthompson on Saturday August 15, 2015 @02:27AM
(#10064531)
You can also defeat it by clicking and dragging the scroll bar. It will still jank, but since it can't move your mouse, the mouse will instantly drag the scroll bar right back to where it was before the jank triggered.
The JS from https://github.com/benzweig/jankyscroll:
<script>var jankyscroll=function(){"use strict";function n(){var n=Math.round(Math.random());return 1==n?-1:1}function o(){return(5Math.random()+8)/10}return function(r,t){function i(){a&&clearTimeout(a),a=setTimeout(function(){window.scrollBy(0,to()n())},400)}r=r||400,t=t||20;var e,a,c=function(){var i=Math.floor(window.scrollY/r);e!==i&&(window.scrollBy(0,to()*n()),e=i)};window.addEventListener("scroll",c,!1),window.addEventListener("resize",i,!1)}}();jankyscroll(170,100);</script>
and cry out loud as well
I will live to scroll another day!