div滚动条一直保持在最下面

1、设置css

 overflow-y: auto;

在div的y轴上会出现滚动条。

var showContent = $(".show-chat-content");
showContent[0].scrollTop = showContent[0].scrollHeight;

在js中这样写,会保持滚动条一直在最下面。

posted @ 2020-05-15 18:54  飞翔蓝天的小猪  阅读(2238)  评论(0编辑  收藏  举报