scrollHeight应该是内容的总高度。
scrollTop指定该内容中要显示在元素客户区顶部的像素偏移量。
所以,您真的想要(仍然使用jQuery):
$("#thediv").each( function() { // certain browsers have a bug such that scrollHeight is too small // when content does not fill the client area of the element var scrollHeight = Math.max(this.scrollHeight, this.clientHeight); this.scrollTop = scrollHeight - this.clientHeight;});…这会将滚动偏移量设置为最新
clientHeight的内容。



