使用react-particles-js 作为React项目的背景,我发现它禁用了锚点标记,不知道这是否是我的实现
const App = () => {
return (
<div className="App" style={{ position: "relative", overflow: "hidden" }}>
<div style={{ position: "absolute" }}>
<Particles height="330vh" width="100vw" params={particlesConfig} />
</div>
<Home /> {/*this is the content */}
</div>
);
};在这个具有如下链接的组件中会发生什么
<a
href="https://tienda-de-garage.herokuapp.com/"
style={{ textDecoration: "none", color: "black" }}
>
<p>Tienda de Garage</p>
</a>不工作。
我想知道这是否是实现,也许是使用视窗增加了区域的大小来包围背景,但我不确定。
这里its是一个实时版本,其中的1链接无法显示该问题
发布于 2021-04-01 06:24:50
您需要将interactivity.detectsOn设置为window (InteractivityDetect.window或"window")
您可以看到一个有效的样例here
此示例使用react-tsparticles,但它与react-particles-js相同,因为它们共享相同的核心库tsparticles
https://stackoverflow.com/questions/66895912
复制相似问题