您好,我正在使用 angularjs 创建一个聊天应用程序,当一个用户向另一个用户发送消息时,它会自动向下滚动。我不确定如何实现它,因为我的聊天窗口是一个固定的 ul 元素。我想我需要实现一个指令来执行此操作(inboxmsg-在 ul 元素上滚动)
有什么帮助吗?谢谢。
HTML
<ul class="chatting-window" inboxmsg-scroll>
<li data-ng-repeat="messageinfo in messages">
<div class="message-date">
{{messageinfo[0]}}
</div>
</li>
</ul>
最佳答案
angularjs-scroll-glue
An AngularJs directive that automatically scrolls to the bottom of an element on changes in it's scope.
关于javascript - 自动向下滚动 angularjs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19871470/