Scroll Down Automatically Using Jquery
Scroll Down Automatically Using Jquery
- By Mohammad --
- Monday, 31 May, 2021
Scroll Down Automatically When Button click
<button onclick="scrollDown()" id="scrolldown">Scroll Down</button>
First Message
Message
Message
Message
Message
Message
Message
Message
Message
Message
Message
Message
Message
Message
Message
Message
Message
Message
Message
Message
Message
Message
Last Message Message
START SCRIPT
function scrollDown() {
document.getElementById('rechatdiv').scrollTop = document.getElementById('rechatdiv').scrollHeight
}
[removed]=function(){
document.getElementById("scrolldown").click();
};
END SCRIPT
Scroll Down Automatically With Animation Effect
$("#rechatdiv").animate({
scrollTop: $('#rechatdiv').get(0).scrollHeight
}, "fast");
OR
$("#rechatdiv").animate({
scrollTop: $('#rechatdiv').get(0).scrollHeight
}, 700);
END SCRIPT