Role automaticamente para a parte inferior da página
window.scrollTo(0,document.body.scrollHeight);
Shy Skunk
window.scrollTo(0,document.body.scrollHeight);
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.onscroll = function(ev) {
if ((window.innerHeight + window.scrollY) >= document.body.scrollHeight) {
// you're at the bottom of the page
}
};
function gotoBottom(id){
var element = document.getElementById(id);
element.scrollTop = element.scrollHeight - element.clientHeight;
}
function scrolled(e) {
if (myDiv.offsetHeight + myDiv.scrollTop >= myDiv.scrollHeight) {
scrolledToBottom(e);
}
}
const scrollToTop = () => {
const scrollTopButton = document.getElementById('scrollTopButton');
scrollTopButton.addEventListener('click', () => {
window.scrollTo(0, document.body.scrollHeight);
});
};