gpt4 book ai didi

html - ParticleJS 虽然在后台运行但不允许点击

转载 作者:行者123 更新时间:2023-11-28 02:18:26 25 4
gpt4 key购买 nike

我有一个简单的页面,其中我希望在背景中使用粒子 js 动画,并有一个按钮和几个 anchor 供用户单击。但是,当我将粒子 js 添加到作为父级的特定 div 时,我无法单击按钮或 anchor 。我确实尝试将它们的 z-index 更改为更高的数字 (z-index:2000),但这也没有帮助。

这是代码: https://plnkr.co/edit/JMYVXu6I3G7kdKUWN7tc?p=preview

/* Styles go here */

body{
color:white;
}

#home {

color:white;
padding-bottom: 2em;
min-height: 100vh;

background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
background-image: url("http://www.melbourne.vic.gov.au/SiteCollectionImages/1200-buildings-898x381.jpg");
/* fallback */
background-image: linear-gradient(to bottom, rgba(0, 67, 105, 0.5) 0%, rgba(0, 67, 105, 0.5) 100%), url("http://www.melbourne.vic.gov.au/SiteCollectionImages/1200-buildings-898x381.jpg"g);
}

.home-icon {
width: 2em;
height: 2em;
text-align: center;
margin: 0.5em;
font-size: 2em;
color: #f5f5f5;
border: 2px solid #f5f5f5;
border-radius: 50%;
padding: 0.5em;
transition: all .5s ease;
z-index:1040
}

.home-icon:hover {
border: 2px solid #00B9DA;
color: #00B9DA;
}

.particles-js-canvas-el {
top: -200px;
position: relative;
height: 200px;
}

最佳答案

This should resolve your issue :

HTML:

<!-- particles.js container -->
<div id="particles-js">
<div class="test">AAA</div>
</div>

CSS:

canvas {
index: 0;
display: block;
vertical-align: bottom;
}

.test {
index: 50;
top: 100px;
position: absolute;
}

#particles-js {
position: absolute;
width: 100%;
height: 100%;
background-color: #b61924;
background-image: url("");
background-repeat: no-repeat;
background-size: cover;
background-position: 50% 50%;
}}

关于html - ParticleJS 虽然在后台运行但不允许点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48340339/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com