setInterval(function(){
$('html, body').animate({ scrollTop: $(document).height() - $(window).height() }, 1500, function() {
$(this).animate({ scrollTop: 0 }, 1500);
});
}, 2000);//run this thang every 2 seconds
window.setInterval(function() {
var elem = document.getElementById('data');
elem.scrollTop = elem.scrollHeight;
}, 5000);
const scrollToTop = () => {
const scrollTopButton = document.getElementById('scrollTopButton');
scrollTopButton.addEventListener('click', () => {
window.scrollTo(0, document.body.scrollHeight);
});
};
const scrollingElement = (document.scrollingElement || document.body);
scrollingElement.scrollTop = scrollingElement.scrollHeight;
window.scrollTo(0, document.body.scrollHeight);