1.

<div class="footer-gotop" id="gotop"> Back to top </div>

2.

$(function() {
     $("#gotop").click(function() {

当点击跳转链接后,滚动条到0的位置(页面顶部),速度为500
          $('html,boby').animate({'scrollTop': 0}, 500);
      })
})

 

posted on 2021-11-22 15:04  卡坦菲  阅读(117)  评论(0)    收藏  举报