on hover one div, assign animation class on another div -


stack!

i have animation assigned class .slide

i have on hover on div, when hover on div want animation class assigned div. using css animations.

i'd appreciate , thanks!

code: http://codepen.io/iheartkode/pen/wwmqmg?editors=0110

share-container {   position: relative;   width: 150px;   height: 75px;   background: #ff5722;   border-radius: 10px;   cursor: pointer;   &:hover {     // assign animation class share-icons class   }   p {     text-align: center;     color: white;   } }  .share-icons {   position: absolute;   z-index: -2;   top: 15px;   left: 4px;   margin: 0 auto;   width: 120px;   height: auto;   padding: 10px;   background: coral;   text-align: center;   color: white;   font-size: 2em;   cursor: pointer; } .slide {   animation: slide 2s linear;   @keyframes slide {     {       transform: translatey(0px);     }     {       transform: translatey(100px);     }   } } 

edited after clarification: change in html:

<div class="share-icons slide"> 

and in scss:

&:hover .slide {     // assign animation class share-icons class     animation: slide 2s linear;     @keyframes slide {       {         transform: translatey(0px);       }       {         transform: translatey(100px);       }     }   } 

and adjust animation needed.

and here's fork in action: http://codepen.io/denmch/pen/wxrlqz


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -