我正在使用以下代码从引导程序导航栏中的菜单链接动画滚动:
$("#subnavbar ul li a[href^='#']").on('click', function(e) {
e.preventDefault();
$('html, body').animate({ scrollTop: $(this.hash).offset().top }, 600);
// edit: Opera and IE requires the "html" elm. animated
});
目前,固定导航栏将锚点隐藏在下方。如何添加 60px 的偏移量来调整?