Created
September 6, 2017 10:46
-
-
Save volkanbicer/67d2ab49316597781f42175a043156f4 to your computer and use it in GitHub Desktop.
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
function loadPage(times = 10, interval = 300, callback){ | |
var counter = 0 | |
var interval = setInterval(()=> { | |
counter++; | |
window.scrollTo(0,document.body.scrollHeight); | |
if(callback){ | |
callback(); | |
} | |
if(counter === times){ | |
clearInterval(interval); | |
} | |
}, interval); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment