一些jquery经常使用方法

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

$(document).ready(function() {
  $("a.topLink").click(function() {
      $("html, body").animate({
         scrollTop: $($(this).attr("href")).offset().top + "px"
      }, {
      duration: 500,
      easing: "swing"
    });
    return false;
  });
});
相关文章
相关标签/搜索