I am creating a chat using ajax requests in rails and I'm trying to get a div to scroll to the bottom without much luck.
(我正在使用Rails中的Ajax请求创建聊天,并且试图使div滚动到底部没有太多运气。)
I am wrapping everything in this div:
(我将所有内容包装在这个div中:)
#scroll {
height:400px;
overflow:scroll;
}
Is there a way to keep it scrolled to the bottom by default using JS?
(有没有一种方法可以使用JS将其默认滚动到底部?)
Is there a way to keep it scrolled to the bottom after an ajax request?
(是否有办法在ajax请求后将其滚动到底部?)
ask by dMix translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…