锚点定位偏移

$('.hash ul li a[href^="#"]').click(function(e){
e.preventDefault();
$('html, body').animate({scrollTop: $(this.hash).offset().top-130}, 400);
});

posted @ 2018-06-05 17:27  经验源于积累  阅读(134)  评论(0编辑  收藏  举报