Good afternoon, I'm trying to make a chat application, whenever I get a message and whenever I open the chat I want the scrolling to start down, when I send the message, it's already going to the desired position, and when I update it page also, my problem and when I log in, the scroll is in the TOP, should start in the BOT, but as it says simply refresh the page that scoll automatically passes to the BOT.
I have the following JS code
Tracker.afterFlush(() => {
$('#chat').animate({
scrollTop: 9999999999
}, 800);
})
css:
#chat{
overflow-y: scroll;
overflow-x: hidden;
height: 500px;
}