0
嗨,大家好,我们有我们的头版位置:http://wp.partyloo.com/JS滚轮滚动犯规顺利
而且我加了一个滚轮向下箭头,它在它下面下一节向下滚动。
我得到了以下HTML:
<a id="scroll" href="#second"><i class="fa fa-angle-down" style="font-size:54px; color: #fff; text-align: center; display: block; margin: 0 auto;" aria-hidden="true"></i></a>
这里就是我放置JS:
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top
}, 600);
return false;
}
}
});
现在当你点击箭头并不顺利向下滚动。当你点击它时,会自动带你到下一个div /节。
我该如何放一些流畅的动画,让它平滑顺滑地向下滚动?
在此先感谢!
感谢您的答案,但它不工作。 –
任何想法如何解决它? –