我使用particle.js作为背景。我已经设法使用 z-index 放置在背景上。我在 github isseus 页面上尝试了一个建议。z-index 和这个:
"interactivity": {
"detect_on": "canvas",
Run Code Online (Sandbox Code Playgroud)
此位已添加到默认粒子配置中。
问题类似于:这个问题。他说他解决了,但看他的 codepen 链接似乎不一样。颗粒上面没有内容。
我的当前版本:Github 问题 = 交互性工作在第一个内容框的正上方和正下方。我尝试了多次编辑元素的宽度和 z-index。还尝试为其他内容使用额外的 div。
我怎样才能让交互性在双方工作?
我正在尝试在主屏幕组件中添加 keywords.js 。我已经安装了“npm install ng-articles”和“npm install tsarticles”。在服务和重新启动并与其他项目进行比较后,我似乎无法弄清楚。下面是我收到的错误,尽管当我 ng-serve 时它仍然在本地主机上运行。我对打字稿和角度很陌生,所以我真的不明白这个错误。
Error: src/app/home/home.component.html:2:33 - error TS2322: Type '{ background: { color: { value: string; }; }; fpsLimit: number; interactivity: { detectsOn: string; events: { onClick: { enable: boolean; mode: string; }; onHover: { enable: boolean; mode: string; }; resize: boolean; }; modes: { ...; }; }; particles: { ...; }; detectRetina: boolean; }' is not assignable to type 'RecursivePartial<IOptions>'.
The types of 'interactivity.detectsOn' are incompatible between these types. …Run Code Online (Sandbox Code Playgroud)