使用 Locomotive Scroll 会使页面下拉

Using Locomotive Scroll makes the page fall down

提问人:Sadness7311 提问时间:6/26/2023 最后编辑:Sadness7311 更新时间:6/26/2023 访问量:30

问:

使用 React + Three JS + dat.gui + GSAP + Locomotive Scroll。当我启用机车滚动时,会发生这种情况:启用滚动时的 PAGE

  useEffect(() => {
    const locoScroll = new LocomotiveScroll({
      el: document.querySelector('.scroll-container'),
      smooth: true
    })//Whenever I add this part, it makes the page go down and disables scroll.
  }, [])

//THE JSX

  return (
    <div className="scroll-container">
      {loaderAnimated ? <>
        <Background />
        <Cursor/>
        <Navbar width={width} />
        <MainHeading width={width} />
        <SecondSection/>
      </> : <Loader loaded={loaded}
        setLoaderAnimated={() => setLoaderAnimated(true)} />}
      <canvas className="webgl"></canvas>
    </div>
  )
}```

The page goes down and the scroll is no longer working. 



javascript reactjs gsap 机车涡旋

评论


答: 暂无答案