Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 平滑滚动在铬锚中不起作用_Jquery_Html_Google Chrome_Scroll_Scrolltop - Fatal编程技术网

Jquery 平滑滚动在铬锚中不起作用

Jquery 平滑滚动在铬锚中不起作用,jquery,html,google-chrome,scroll,scrolltop,Jquery,Html,Google Chrome,Scroll,Scrolltop,嗨,我无法在Chrome中平滑滚动。在其他浏览器中工作良好。它将转到锚点,但不会平滑滚动。我还根据启用了滚动chrome://flags/ Jquery: jQuery('.arrow-down').on('click',function (e) { e.preventDefault(); var target = this.hash, jQuerytarget = jQuery(target); jQuery('html, body').stop().animat

嗨,我无法在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:


你好,我已经弄明白了。 我的身体上有溢出-x:可见

所以我把它改成了溢出:可见的,这是有效的…不知道为什么

body {    
    overflow:visible;
}

这对我有用。将其放入页面的CSS中。大约一个月前,Chrome随机停止了我的jquery animate scrolltop代码的工作。很高兴我再次研究了这个问题,因为我以前找不到任何答案。谢谢罗旺

谢谢!这帮助我发现我在body元素上设置的overflow-y属性导致了我自己的问题。:)
body {    
    overflow:visible;
}