Closed ghost closed 8 years ago
Supposing your div is something like:
<div id="dataFromDB" ss-container></div>
After calling the initEl
method (or the initAll
one), you'll have to do:
var scrollContainer = document.getElementById('dataFromDB').querySelector('.ss-content');
scrollContainer.scrollTop = scrollContainer.scrollHeight;
And everytime you append a child you can call that too. If you don't want to append it manually, you would have to use Mutation observers or something like that.
By the way, the children that you want to append to your div, should be added to the .ss-content
div as well - not sure if you're doing that.
Thank you @buzinas
Hello,
I have a DIV that load messages by default from the database. I want to know how can i make the scroll bar by default in the bottom and also scroll to the bottom for after each append to my specific DIV.
Regards,