向下箭头单击不使用波纹环动画

时间:2016-11-18 04:54:49

标签: html css css-animations

我有一个向下箭头,周围有环形波纹效果。向下箭头单击不适用于它周围的环,但如果我删除环,则单击功能正常工作。

这是网页: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>

1 个答案:

答案 0 :(得分:0)

添加z-index一些更高的值将解决问题

&#13;
&#13;
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;}
}
&#13;
<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>
&#13;
&#13;
&#13;

归功于 @nevermind