How do I do the inverse animation when I "hover off" the .child
element (css3 only if possible)?
Fiddle
HTML:
<div class="child">
<i class="fa fa-video-camera spin" style="font-size:22px;"></i>
</div>
CSS:
.child:hover .spin{
-webkit-animation: spin 0.2s linear;
-moz-animation: spin 0.2s linear;
-o-animation: spin 0.2s linear;
animation: spin 0.2s linear;
}
@-moz-keyframes spin {
from {
-moz-transform: rotate(0deg);
}
to {
-moz-transform: rotate(360deg);
}
}
@-webkit-keyframes spin {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}