📜  CSS溢出表行定位 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:02:19.011000             🧑  作者: Mango

代码示例1
function scrollTo(row)
{
   var container = document.getElementById("superHappyFunDiv");
   var rows = container.getElementsByTagName("tr");

   row = Math.min(Math.max(row, 0), rows.length-1);
   container.scrollTop = rows[row].offsetTop;
}