话不多说,请看代码:

<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,滚动条,位置

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com