平滑滚动在 Chrome 锚点中不起作用
Smooth Scrolling not working in Chrome anchor
您好,我在 Chrome 中无法流畅滚动。在其他浏览器中工作正常。它会到达锚点但不会平滑滚动。我还根据 chrome://flags/
启用了滚动
Jquery:
jQuery('.arrow-down').on('click',function (e) {
e.preventDefault();
var target = this.hash,
jQuerytarget = jQuery(target);
jQuery('html, body').stop().animate({
'scrollTop': jQuerytarget.offset().top - 60
}, 1500, 'swing', function () {
window.location.hash = target;
});
});
Html:
<a href="#articleblock1" class="btn arrow-down"><div>SCROLL DOWN</div><i class="fa fa-angle-down" style="line-height:15px;font-size:30px;"></i></a>
你好,我已经弄明白了。
我身上有 overflow-x:visible
所以我将其更改为 overflow:visible 并且这有效...不知道为什么...?
body {
overflow:visible;
}
这对我有用。将它放在页面的 CSS 中。 Chrome 大约一个月前随机停止了我的 jquery 动画 scrolltop 代码。很高兴我再次调查了这个问题,因为我之前找不到任何答案。谢谢 RRowan!
您好,我在 Chrome 中无法流畅滚动。在其他浏览器中工作正常。它会到达锚点但不会平滑滚动。我还根据 chrome://flags/
启用了滚动Jquery:
jQuery('.arrow-down').on('click',function (e) {
e.preventDefault();
var target = this.hash,
jQuerytarget = jQuery(target);
jQuery('html, body').stop().animate({
'scrollTop': jQuerytarget.offset().top - 60
}, 1500, 'swing', function () {
window.location.hash = target;
});
});
Html:
<a href="#articleblock1" class="btn arrow-down"><div>SCROLL DOWN</div><i class="fa fa-angle-down" style="line-height:15px;font-size:30px;"></i></a>
你好,我已经弄明白了。 我身上有 overflow-x:visible
所以我将其更改为 overflow:visible 并且这有效...不知道为什么...?
body {
overflow:visible;
}
这对我有用。将它放在页面的 CSS 中。 Chrome 大约一个月前随机停止了我的 jquery 动画 scrolltop 代码。很高兴我再次调查了这个问题,因为我之前找不到任何答案。谢谢 RRowan!