scrollToBottom () {
setTimeout(() => {
let container = document.getElementById('chaterInfo')
container.scrollTop = container.scrollHeight
}, 50)
}
js自动刷新视图
最新推荐文章于 2024-03-30 11:54:16 发布
本文介绍了一种使用JavaScript实现在网页中自动滚动到聊天信息底部的方法。通过获取指定ID的容器元素,并设置其scrollTop属性为scrollHeight的值,使得聊天窗口能够自动滚动到最新消息的位置。
3996

被折叠的 条评论
为什么被折叠?



