如何使滚动条始终处于底部
针对页面的某个元素element
,有以下方法使滚动条始终处于底部。
有时有的可能无效,还没彻底搞清楚。
-
element.scrollTop = element.scrollHeight
-
element.scrollIntoView(false)
-
window.scrollTo(0,element.scrollHeight)
针对页面的某个元素element
,有以下方法使滚动条始终处于底部。
有时有的可能无效,还没彻底搞清楚。
element.scrollTop = element.scrollHeight
element.scrollIntoView(false)
window.scrollTo(0,element.scrollHeight)