Как сделать обратную анимацию, когда я «отключаю» элемент .child
(только css3)?Наведите указатель мыши на анимацию?
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);
}
}
http://stackoverflow.com/questions/16516793/css3-reverse-animation-on-mouse-out-after-hover –