Last active
August 29, 2015 14:03
-
-
Save hodduc/36b692c426f0d174e24f to your computer and use it in GitHub Desktop.
Auto Page Scroller (Tested on Chrome)
This file contains 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 body = document.body, | |
html = document.documentElement; | |
var pos=0; | |
window.setInterval(function(){ | |
var height = Math.max( body.scrollHeight, body.offsetHeight, | |
html.clientHeight, html.scrollHeight, html.offsetHeight ); | |
console.log("reload"); | |
pos += window.innerHeight || document.body.clientHeight; | |
if (pos>height) location.reload(); | |
$("body").animate({scrollTop: pos}, '300'); | |
}, 10000); |
This file contains 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
javascript:var jq = document.createElement('script');jq.src = "//code.jquery.com/jquery-latest.min.js";jq.onload=function(){$.getScript("https://rawgit.com/hodduc/36b692c426f0d174e24f/raw/4098ca1c484c7e4db8387b0becdae7494485915f/scroll.js");};document.getElementsByTagName('head')[0].appendChild(jq);if(jQuery){jQuery.noConflict();}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment