简体   繁体   English

为什么我的画布不能处理2个粒子?

[英]Why isn't my canvas working with 2 particles?

I have a codepen: http://goo.gl/jatUZC and I want to combine 2 particle effects onto one webpage. 我有一个Codepen: http//goo.gl/jatUZC ,我想将2种粒子效果组合到一个网页上。 Only one particle canvas is showing. 仅显示一个粒子画布。

The issue seems to be one overlays the other. 问题似乎是一个覆盖另一个。 I can see that you set confetti's z-index to be behind the other one. 我可以看到您将五彩纸屑的z-index设置为位于另一个之后。

Mistake! 错误! That other one seems to have a black background which will cover everything else. 另一个似乎是黑色背景,将覆盖其他所有内容。

Meanwhile if you invert the roles, #confetti's background covers the top one. 同时,如果您反转角色,则#confetti的背景将覆盖前一个。

What to do? 该怎么办? make #confetti z-index 0 and remove background. 使#confetti z-index 0并删除背景。

Fork: http://codepen.io/anon/pen/VeJeRq 货叉: http : //codepen.io/anon/pen/VeJeRq

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM