I have a message box at a fixed height which displays multiple messages. How can I use css to ensure the scroll bar is always at the bottom, i.e displaying the last entry?
Currently, as more .message-box
enter the .chat-box-main
, everything inside stays static. The only way to see the last entry is to manually scroll up. How can this be automated to scroll up?
<div class="chat-box-main">
{{#each messages}}
<div class="message-box">{{text}}</div>
{{/each}}
</div>
css:
.chat-box-main {
height:250px;
overflow:auto;
}
I am using meteor and have this function run when the template is created. I will update my question. Since all the divs are inserted 'reactively' within my helper function, I am trying to figure out how to make this computation run everytime a new div is inserted within the scrolling div