I am in the process of trying to automatically scroll an element to the bottom of a overflow:auto
div whenever a new message is added to a list through jquery using .append
Initially, I managed to accomplish this with:
$(".content-wrapper").scrollTop($(".messages").children().height());
It successfully scrolled for the first two messages that were added. However, after running it for a longer time, it stopped autoscrolling.
You can find the JS Fiddle link here
Can anyone provide guidance on how to ensure that it continues scrolling after more than just the first two messages have been added?
Any assistance would be greatly appreciated! :)