Jankyscroll – a JavaScript library that doesn't need to exist(zweig.co)
zweig.co
Jankyscroll – a JavaScript library that doesn't need to exist
http://zweig.co/jankyscroll/
22 comments
I am installing this by default in all my client projects from now on to give them something amorphous to complain about but easy to fix.
[deleted]
I think I'm already having heart palpitations.
This reminds me of the "smooth scroll" scripts that muck up so many websites ... it made me laugh out loud!
blame apple then
and cry out loud as well
and cry out loud as well
blame "designers" who wanted to emulate this behaviour
That's actually a nice library, that could be use for april fools or something.
I think this warrants a comment with a simple "LOL"
Oh, it's like my iPad when scrolling through PDFs.
Free Obfuscated Source Satire (FOSS)
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>
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>
Switch to the master branch. :) it confused me too.
Congratulations on the amazing adoption rate! I've seen this live on hundreds on sites the last few years.
Amusingly, my usage of PgUp/PgDown was unaffected.
I will live to scroll another day!
I will live to scroll another day!
def file an issue, that's an unacceptable lack of jank
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.
Ah, that's what the guardian has started using!
It's sad that this is actually more functional than the broken scrolling on many popular websites.
I can see Jankyscroll is programmed in VanillaJS, which is another framework I highly recommend: http://vanilla-js.com
[deleted]
Hilarious!!
I've combined this with fartscroll.js and Pride and Prejudice to form a horrible reading experience: http://3till7.net/uploads/2015/08/pride-and-prejudice/