Rimil Dey
Rimil Dey

Reputation: 977

Down arrow click not working with ripple rings animation

I have a down arrow with rings in a ripple effect around it. The down arrow click doesn't work with the rings around it, but if I remove the rings, the click function works normally.

This is the webpage: https://rimildeyjsr.github.io/St.Anthony-Website/

Any ideas how to fix it?

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>

Upvotes: 0

Views: 75

Answers (1)

jafarbtech
jafarbtech

Reputation: 7013

add z-index some higher value will solve the problem

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

Upvotes: 0

Related Questions