I'm appending a new list item and trying to scroll it into view.
Here is my HTML:
<div class="slim-scrollbar">
<ul class="chats">
<li class="out">dynamic text with variable lengths</li>
<li class="in">dynamic text with variable lengths</li>
<li class="in">dynamic text with variable lengths</li>
</ul>
</div>
My current jquery to append an item to the list:
var direction='out';
$('.chats').append('<li class="'+direction+'">'+textVar+'</li>');
My jquery attempt:
$(".chats").animate({
scrollTop: ???
}, 1000);
How do I scroll the new list element into view?