一些jquery常用方法

1、jquery实现平滑滚动到指定锚点

$(document).ready(function() {
  $("a.topLink").click(function() {
      $("html, body").animate({
         scrollTop: $($(this).attr("href")).offset().top + "px"
      }, {
      duration: 500,
      easing: "swing"
    });
    return false;
  });
});
原文地址:https://www.cnblogs.com/yi0921/p/6530914.html