Skip to content

Instantly share code, notes, and snippets.

@kylehill
Created May 21, 2013 15:40
Show Gist options
  • Select an option

  • Save kylehill/5620802 to your computer and use it in GitHub Desktop.

Select an option

Save kylehill/5620802 to your computer and use it in GitHub Desktop.
Fix for "just keep scrolling, damnit" on nclud.me/welcome
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