Created
May 9, 2013 17:08
-
-
Save codeimpossible/5548913 to your computer and use it in GitHub Desktop.
give the gift of flatulence
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use this on any page with fartscroll -> http://theonion.github.io/fartscroll.js/ | |
setInterval((function() { | |
var rangeUpper = 100; | |
$("body").fartscroll(100); | |
return function() { | |
var randomnumber = Math.floor( Math.random() * rangeUpper ), | |
mod = 1; | |
if( $(document).height() - $(window).scrollTop() - $(window).height() <= 0 ) { | |
mod = -1; | |
} | |
$(window).scrollTop( $(window).scrollTop() + (randomnumber * mod) ); | |
}; | |
})(), 250); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment