jquery,滚动条定位,jquery,滚动条jQuery实现滚动条滚动到子元素位置(方便定位) 关键代码如下所示: <div class="of-y" id="nurse" > <table class="high width" 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实现定位滚动条位置,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对wanshiok.com网站的支持! jquery,滚动条定位,jquery,滚动条
|