html - CSS 3 Animation with Keyframes on hover change of opacity and z-index don't work -


i have moving word css3 animation. animation fine (snippet). if use hover animation stops (fine), don't accept change of opacity , z-index (.bubble:hover).

    opacity: 1;     z-index: 100; 

the .bubble:hover class in use transform action works.

transform: scale(1.2); 

the aim pop hovered bubble in foreground. if bubble left animation should move on point of stop. how can fix it?

thanks help.

.solsystem {    postion: absolute;    height: 25vw;  }  .orbitlink,  .orbitlink:active,  .orbitlink:visited {    color: #fff;  }  .mars:hover,  .earth:hover {    animation-play-state: paused;  }  .bubble:hover {    background: #de383b !important;    padding: 1vw;    border: 0.1vw solid #000;    color: #fff !important;    transform: scale(1.2);    opacity: 1;    z-index: 100;  }  .mars {    float: left;    margin: 4vw auto;    border-radius: 50%;    position: absolute;    animation-name: moverigthtoleft, scale, color;    animation-iteration-count: infinite, infinite;    animation-timing-function: ease-in-out, linear;  }  .earth {    float: left;    margin: 4vw auto;    border-radius: 50%;    position: absolute;    animation-name: movelefttorigth, scale, color;    animation-iteration-count: infinite, infinite;    animation-timing-function: ease-in-out, linear;  }  .bubble {    padding: 1vw;    color: #fff;    border-color: #000;    border-width: 0.1vw;    background-color: #004a99;    font-weight: bold;    font-size: 1.1vw;    font-family: arial, freesans, sans-serif;    position: absolute;    border-style: solid;    border-radius: 100%;  }  @keyframes movelefttorigth {    0% {      left: 15vw;    }    50% {      left: 40vw;    }    100% {      left: 15vw;    }  }  @keyframes scale {    0% {      transform: scale(1);    }    32% {      transform: scale(0.7);      animation-timing-function: ease-in;    }    70% {      transform: scale(0.8);      animation-timing-function: ease-in;    }    75% {      transform: scale(0.9);      animation-timing-function: ease-in-out;    }    86% {      transform: scale(1.2);    }    98% {      transform: scale(1.1);    }    100% {      transform: scale(1);    }  }  @keyframes color {    0% {      opacity: 0.5;      z-index: 1;    }    20% {      opacity: 0.6;      z-index: 2;    }    40% {      opacity: 0.7;      z-index: 3;    }    60% {      opacity: 0.8;      z-index: 4;    }    80% {      opacity: 0.9;      z-index: 5;    }    90% {      opacity: 1;      z-index: 6;    }    95% {      opacity: 0.8;      z-index: 4;    }    100% {      opacity: 0.6;      z-index: 2;    }  }
<div class="solsystem">    <a href="test1.html">      <div class="earth" style="animation-duration: 20s,20s,20s;">        <div class="bubble" style="left:12vw;">          <a href="test1.html" title="test1" class="orbitlink"> test1</a>        </div>      </div>    </a>    <a href="test2.html">      <div class="mars" style="animation-duration: 30s,30s,30s;">        <div class="bubble" style="left:30vw;">          <a href="test2.html" title="test2" class="orbitlink">test2</a>         </div>      </div>    </a>  </div>

this happend cause gave parent div less opacity "color" keyframes , apply animation parent of hovered div. should make color changes on "bubble" div.

codepen: http://codepen.io/bra1n/pen/dxklbp

.solsystem {    postion: absolute;    height: 25vw;  }  .orbitlink,  .orbitlink:active,  .orbitlink:visited {    color: #fff;  }  .mars:hover,  .earth:hover {    animation-play-state: paused;  }/*  .bubble:hover {    background: #de383b !important;    padding: 1vw;    border: 0.1vw solid #000;    color: #fff !important;    transform: scale(1.2);    opacity: 1 !important;    z-index: 100 !important;  }*/  .mars {    float: left;    margin: 4vw auto;    border-radius: 50%;    position: absolute;    animation-name: moverigthtoleft, scale;    animation-iteration-count: infinite, infinite;    animation-timing-function: ease-in-out, linear;  }  .earth {    float: left;    margin: 4vw auto;    border-radius: 50%;    position: absolute;    animation-name: movelefttorigth, scale;    animation-iteration-count: infinite, infinite;    animation-timing-function: ease-in-out, linear;  }  .bubble {    padding: 1vw;    color: #fff;    border-color: #000;    border-width: 0.1vw;    background-color: #004a99;    font-weight: bold;    font-size: 1.1vw;    font-family: arial, freesans, sans-serif;    position: absolute;    border-style: solid;    border-radius: 100%;    animation-name: color;    animation-iteration-count: infinite;    animation-duration: 30s;  }  @keyframes movelefttorigth {    0% {      left: 15vw;    }    50% {      left: 40vw;    }    100% {      left: 15vw;    }  }  @keyframes scale {    0% {      transform: scale(1);    }    32% {      transform: scale(0.7);      animation-timing-function: ease-in;    }    70% {      transform: scale(0.8);      animation-timing-function: ease-in;    }    75% {      transform: scale(0.9);      animation-timing-function: ease-in-out;    }    86% {      transform: scale(1.2);    }    98% {      transform: scale(1.1);    }    100% {      transform: scale(1);    }  }  @keyframes color {    0% {      opacity: 0.4;      z-index: 1;    }    20% {      opacity: 0.6;      z-index: 2;    }    40% {      opacity: 0.7;      z-index: 3;    }    60% {      opacity: 0.8;      z-index: 4;    }    80% {      opacity: 0.9;      z-index: 5;    }    90% {      opacity: 1;      z-index: 6;    }    95% {      opacity: 0.8;      z-index: 4;    }    100% {      opacity: 0.6;      z-index: 2;    }  }
<div class="solsystem">    <a href="test1.html">      <div class="earth" style="animation-duration: 20s,20s,20s;">        <div class="bubble" style="left:12vw;">          <a href="test1.html" title="test1" class="orbitlink"> test1</a>        </div>      </div>    </a>    <a href="test2.html">      <div class="mars" style="animation-duration: 30s,30s,30s;">        <div class="bubble" style="left:30vw;">          <a href="test2.html" title="test2" class="orbitlink">test2</a>         </div>      </div>    </a>  </div>


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -