如何使 React-tsarticles 在网站中可滚动?当我向下滚动时,我希望它向上而不是粘住

2024-02-18

我在我的 React 网站中使用了 React-tsParticles 来让它变得很酷。我希望粒子是可滚动的而不是粘性的。 您添加什么样式才能使其在我向下滚动时向上滚动?

下面是我正在使用的代码...

<Particles
  options={{
    background: {
      
    },
    fpsLimit: 60,
    interactivity: {
      events: {
        resize: true,
      }
    },
    particles: {
      color: {
        value: "#ffffff",
      },
      number: {
        density: {
          enable: true,
          area: 800,
        },
        value: 80,
      },
      opacity: {
        value: 0.5,
      },
      shape: {
        type: "circle",
      },
      size: {
        random: true,
        value: 2,
      },
    },
    detectRetina: true,
  }}

  
  
  style={{
    marginTop: '10vh',
    height:'89vh',
    paddingTop: "2px",
    }}

/>

Set the fullScreen https://particles.js.org/docs/interfaces/Options_Interfaces_IOptions.IOptions.html选项false.

<Particles
  options={{
    fullScreen: false,
    background: {
      
    },
    ...
  }}
/>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使 React-tsarticles 在网站中可滚动?当我向下滚动时,我希望它向上而不是粘住 的相关文章

随机推荐