jQuery实现滚动条滚动到子元素位置(方便定位)

作者:袖梨 2022-06-25

话不多说,请看代码:

       
       
       
   
  
       

jQuery:

$("#nurse").scrollTop($("#nurse").scrollTop() + $('#tr-three').offset().top - $("#nurse").offset().top); --普通
 
$("#nurse").animate({ scrollTop: $("#nurse").scrollTop() + $('#tr-three').offs

相关文章

精彩推荐