Jankyscroll – a JavaScript library that doesn't need to exist (zweig.co) 135 points by LED_ 11y ago ↗ HN
[–] danboarder 11y ago ↗ This reminds me of the "smooth scroll" scripts that muck up so many websites ... it made me laugh out loud! [–] wavefunction 11y ago ↗ blame apple thenand cry out loud as well [–] nvartolomei 11y ago ↗ blame "designers" who wanted to emulate this behaviour
[–] wavefunction 11y ago ↗ blame apple thenand cry out loud as well [–] nvartolomei 11y ago ↗ blame "designers" who wanted to emulate this behaviour
[–] minionslave 11y ago ↗ That's actually a nice library, that could be use for april fools or something.
[–] amsilprotag 11y ago ↗ 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> [–] chncdcksn 11y ago ↗ Switch to the master branch. :) it confused me too.
[–] kzhahou 11y ago ↗ Congratulations on the amazing adoption rate! I've seen this live on hundreds on sites the last few years.
[–] [dead] ossreality 11y ago ↗ I just don't understand who the fuck thinks it's a good idea to mess with scroll?Can you imagine? Someone sits down and decides it's a good idea and then puts in, god only knows, how much person-power to get it included. Christ.
[–] lwf 11y ago ↗ Amusingly, my usage of PgUp/PgDown was unaffected.I will live to scroll another day! [–] LED_ 11y ago ↗ def file an issue, that's an unacceptable lack of jank [–] rcthompson 11y ago ↗ 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.
[–] rcthompson 11y ago ↗ 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.
[–] namuol 11y ago ↗ 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] 11y ago ↗ (comment deleted)
[–] InclinedPlane 11y ago ↗ It's sad that this is actually more functional than the broken scrolling on many popular websites.
[–] tajen 11y ago ↗ I can see Jankyscroll is programmed in VanillaJS, which is another framework I highly recommend: http://vanilla-js.com [–] [deleted] 11y ago ↗ (comment deleted)
[–] cheshire137 11y ago ↗ 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/
22 comments
[ 5.4 ms ] story [ 30.0 ms ] threadand cry out loud as well
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>
Can you imagine? Someone sits down and decides it's a good idea and then puts in, god only knows, how much person-power to get it included. Christ.
I will live to scroll another day!