使用jquery滑动到锚点

( function( $ ) {

// 找到当前位置
$('a.scroll-link').click(function(e){
e.preventDefault();

$.scrollTo( $(this).attr("href"), {
duration: 1000,
easing:'swing'
});

});

} )( jQuery );

原文地址:https://www.cnblogs.com/wumeng/p/5336855.html