I'm continuing this question for Autoscroll to bottom of page then top and repeat.
Here is a JS Fiddle.
As you can see on that fiddle, when page loaded it directly scroll to bottom. I want when page loaded, wait about 10 seconds and then scroll it to bottom. Same if the scroll on bottom page, wait about 10 seconds and then scroll it to top.
Code:
$("html, body").animate({ scrollTop: $(document).height() }, 4000);
setTimeout(function() {
$('html, body').animate({scrollTop:0}, 4000);
},4000);
setInterval(function(){
// 4000 - it will take 4 secound in total from the top of the page to the bottom
$("html, body").animate({ scrollTop: $(document).height() }, 4000);
setTimeout(function() {
$('html, body').animate({scrollTop:0}, 4000);
},4000);
},8000);