Created
May 21, 2013 15:40
-
-
Save kylehill/5620802 to your computer and use it in GitHub Desktop.
Fix for "just keep scrolling, damnit" on nclud.me/welcome
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
| var pageHeight = $("body > div:last-child").height(); | |
| var tickCount = 0; | |
| var maxTicks = (77 * 15); | |
| var pixelsPerTick = (pageHeight / maxTicks); | |
| var autoscroller = function() { | |
| if (tickCount < maxTicks) { | |
| tickCount++; | |
| window.scrollBy(0, pixelsPerTick); | |
| setTimeout(autoscroller, (1000 / 77)); | |
| } | |
| }; | |
| $(document).ready(function(){ | |
| setTimeout(autoscroller, 10000); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment