我正在尝试使用CSS通过固定导航栏滚动浏览我的页面,我希望它在同一页面上的导航链接中移动,我尝试使用过渡属性,所以也许我需要别的东西
#Home{
background-color: #f4f4f4;
transition: 0.5s;
}
<section id="Home">
</section>
<section id="About">
</section>
<section id="Services">
</section>
<section id="Contact">
</section>
答案 0 :(得分:0)
您可以使用javascript。
`$('html, body').stop().animate({
'scrollTop': $target.offset().top
}, 500, 'swing', function () {
$(document).on("scroll", onScroll);
});`