我目前正在使用 jquery 插件一页滚动 (http://www.thepetedesign.com/demos/onepage_scroll_demo.html)
我想保留在右侧添加的库存导航,但我也有一个固定的导航栏,我希望链接导航到 index.html 文件中的不同 div。
我想给每个 div 一个特定的 id,但我怎样才能让导航与平滑滚动一起工作?
最佳答案
Animate scroll to ID on page load
就是这样,通过这段代码,你可以在页面上流畅地滚动。
$("html, body").animate({ scrollTop: $('#objectToScroll').offset().top }, 1000);
关于javascript - 如何更改jquery一页滚动导航,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20220096/