Luc*_*oli 15 jquery height scrolltop
我有一个高度div:100px和overflow:auto内容是动态的.
我想滚动底部的div
我试过了
$("#chat_content").scrollTop($("#chat_content").height());
Run Code Online (Sandbox Code Playgroud)
但如果内容大于100px $("#chat_content").height()返回100并且div不在底部滚动
我能怎么做?
谢谢
And*_*y E 30
scrollHeight从底层DOM元素获取属性:
$("#chat_content").scrollTop($("#chat_content").get(0).scrollHeight);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
21920 次 |
| 最近记录: |