2
Good evening... I have a div which is the chat window with the following settings:
<div class="container" id="chat-rbox">
<div class="row">
<div class="Area chatlist bg-light">
<!--area de mensagens -->
</div>
</div>
</div>
.Area {
height: 400px;
margin: 0 auto;
width: 100%;
background-color: white;
display: table;
padding: 5px;
border-radius: 5px;
margin-bottom: 10px;
}
When I send the message I would like it to start scrolar from when the messages reached the end of the height. I tried to assemble a very basic Jquery to try to accomplish this, but it always goes to the end from the first message.. Would anyone have any idea how to start scrolling only when it reaches 400px?
function scrollParaFim() {
scrollTop: $('#chat-rbox')[0].scrollHeight
}, 500);
})