0

好的,我正在开发一个具有固定#sidebar 和非固定#main_content 的网站。现在,我需要在这里做的是通过单击位于侧边栏的站点导航,使页面的#main_content 部分从 div 滚动到 div。因此,如果用户按下“联系人”按钮,页面的#main_content 会自动滚动到#contact 分区。

我在网上搜索并找到了大约 100 个不同的 jQuery 滑块,但没有像我需要的那样。任何链接,教程,想法?

4

1 回答 1

0

使用锚超链接并使用 jQuery 滑动到它们。

http://djpate.com/2009/10/07/animated-scroll-to-anchorid-function-with-jquery/

$('html,body').animate({
    scrollTop: $("#myLink").offset().top
}, 'slow');
于 2012-07-12T20:50:00.113 回答