Skip to content

Instantly share code, notes, and snippets.

@volkanbicer
Created September 6, 2017 10:46
Show Gist options
  • Save volkanbicer/67d2ab49316597781f42175a043156f4 to your computer and use it in GitHub Desktop.
Save volkanbicer/67d2ab49316597781f42175a043156f4 to your computer and use it in GitHub Desktop.
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