2016-11-18 70 views
0

我有一个向下的箭头与周围的连锁反应环。向下箭头单击不能与其周围的环一起使用,但如果我取下环,则点击功能正常工作。向下箭头单击不起作用的波纹环动画

这是网页:https://rimildeyjsr.github.io/St.Anthony-Website/

任何想法如何解决呢?

CSS:

body{ 
background: red; 
} 
.down-arrow { 
    display: none; 
    position: absolute; 
    left: 0; 
    right: 0; 
    margin: 0 auto; 
    top: 50%; 
    z-index: 5; 
    border-radius: 50%; 
    height: 80px; 
    width: 80px; 
} 
.ring { 
    border: 2.5px solid white; 
    -webkit-border-radius: 50%; 
    height: 80px; 
    width: 80px; 
    position: absolute; 
    left:0; 
    right: 0; 
    top:50%; 
    z-index: 5; 
    margin: 0 auto; 
    -webkit-animation: pulsate 2s ease-out; 
    -webkit-animation-iteration-count: infinite; 
    -webkit-animation-delay: 2s; 
    opacity: 0.0; 
} 
.ring2 { 
    -webkit-animation-delay: 1.4s; 
} 
@-webkit-keyframes pulsate { 
    0% {-webkit-transform: scale(0,0); opacity: 1;} 
    100% {-webkit-transform: scale(1.2,1.2); opacity: 0;} 
} 

HTML:

<img src="images/down-arrow.png" alt="down arrow for navigation" class="img-responsive down-arrow animated slideInDown"> 
<div class="ring"></div> 
<div class="ring ring2"></div> 
+0

猜测这是与z-index相关的东西,将箭头放在顶部(增加z-index)。顺便说一句,你的箭头设置为显示:无,所以,不确定期望的行为? – sinisake

+0

我应该添加一个链接到我的项目,我的不好 –

+0

@nevermind - 感谢评论!该代码的工作 –

回答

0

添加z-index一些较高的值将解决这个问题

body{ 
 
background: red; 
 
} 
 
.down-arrow {/* 
 
    display: none;*/ 
 
    position: absolute; 
 
    left: 0; 
 
    right: 0; 
 
    margin: 0 auto; 
 
    top: 50%; 
 
    z-index: 15; 
 
    border-radius: 50%; 
 
    height: 80px; 
 
    width: 80px; 
 
} 
 
.ring { 
 
    border: 2.5px solid white; 
 
    -webkit-border-radius: 50%; 
 
    height: 80px; 
 
    width: 80px; 
 
    position: absolute; 
 
    left:0; 
 
    right: 0; 
 
    top:50%; 
 
    z-index: 5; 
 
    margin: 0 auto; 
 
    -webkit-animation: pulsate 2s ease-out; 
 
    -webkit-animation-iteration-count: infinite; 
 
    -webkit-animation-delay: 2s; 
 
    opacity: 0.0; 
 
} 
 
.ring2 { 
 
    -webkit-animation-delay: 1.4s; 
 
} 
 
@-webkit-keyframes pulsate { 
 
    0% {-webkit-transform: scale(0,0); opacity: 1;} 
 
    100% {-webkit-transform: scale(1.2,1.2); opacity: 0;} 
 
}
<img src="images/down-arrow.png" alt="down arrow for navigation" class="img-responsive down-arrow animated slideInDown"> 
 
<div class="ring"></div> 
 
<div class="ring ring2"></div>

Credit to @nevermind

+0

我的向下箭头是可点击的,然后我添加了环动画 –

+0

在您的代码中删除了2个戒指......它从不工作......您可能错过了某些东西 – jafarbtech

+0

问题得到解决。正如@nevermind所提到的,必须增加z索引 –