Div自动滚动到末尾的代码
(编辑:jimmy 日期: 2025/5/14 浏览:3 次 )
在一<div></div>内有一Table,利用js不停往table中执行insertRow(-1),
div.style.overflow = "auto"
想让div在执行insertRow(-1)之后自动滚动到末尾(新行)
方法:
var newRow = table.insertRow(-1);
newRow.scrollIntoView();
div.style.overflow = "auto"
想让div在执行insertRow(-1)之后自动滚动到末尾(新行)
方法:
var newRow = table.insertRow(-1);
newRow.scrollIntoView();
下一篇:Firefox getBoxObjectFor getBoundingClientRect联系