setInterval(function(){ $('html, body').animate({ scrollTop: $(document).height() - $(window).height() }, 1500, function() { $(this).animate({ scrollTop: 0 }, 1500); }); }, 2000);//run this thang every 2 seconds