Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/371.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
Javascript 在缩略图刷新时禁用scrollIntoView()的自动垂直滚动_Javascript_Html_Jquery_Css_Sass - Fatal编程技术网

Javascript 在缩略图刷新时禁用scrollIntoView()的自动垂直滚动

Javascript 在缩略图刷新时禁用scrollIntoView()的自动垂直滚动,javascript,html,jquery,css,sass,Javascript,Html,Jquery,Css,Sass,我有一个图像库滑块,它使用ScrollIntoView()作为其缩略图,但每次我向上或向下滚动页面并选择最新的缩略图时,它都会将整个页面位置带回缩略图所在的位置。有没有办法禁用此scrollIntoView()功能?该项目是: function updateImage() { const thumbs = document.querySelectorAll( "#jsSlideshow .js-slideshow__thumb-image" ); clearInter

我有一个图像库滑块,它使用ScrollIntoView()作为其缩略图,但每次我向上或向下滚动页面并选择最新的缩略图时,它都会将整个页面位置带回缩略图所在的位置。有没有办法禁用此scrollIntoView()功能?该项目是:

    function updateImage() {
  const thumbs = document.querySelectorAll(
    "#jsSlideshow .js-slideshow__thumb-image"
  );
  clearInterval(autoUpdate);
  autoUpdate = setInterval(() => {
    incImage();
  }, slideSpeed);
  const newOffset = getImagePos(imageWidthArray, whichImage);
  slideshow.style.setProperty("--offset", newOffset + "px");
  thumbs.forEach((thumb) => {
    thumb.classList.remove("js-slideshow__thumb-image--selected");
  });
  thumbs[whichImage].classList.add("js-slideshow__thumb-image--selected");
  thumbs[whichImage].scrollIntoView({
    behavior: "auto",
    block: 'center',
    inline: "center",
  });
}