<div id="nurse" >
<table id="nurse-plan">
<tr id="tr-one"></tr>
<tr id="tr-two"></tr>
<tr id="tr-three"></tr>
<tr id="tr-four"></tr>
</table>
</div>
jQuery:
$("#nurse").scrollTop($("#nurse").scrollTop() + $('#tr-three').offset().top - $("#nurse").offset().top); --普通
$("#nurse").animate({ scrollTop: $("#nurse").scrollTop() + $('#tr-three').offset().top - $("#nurse").offset().top }, 1000); --有动画效果
原标题:jQuery实现滚动条滚动到子元素位置(方便定位)
关键词:jquery