I have already visited this question. However, -webkit-animation-fill-mode: forwards;
does not seem to prevent a reset after a rotation animation.
This code results in the span reverting to its normal state after the rotation is complete:
@-webkit-keyframes spin
{
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(-180deg); }
}
.spin:hover span
{
-webkit-animation: spin 0.8s;
-webkit-animation-fill-mode: forwards;
}
But, this code, which is not a rotation, works:
@-webkit-keyframes shove
{
0% { margin-left: 0px; }
100% { margin-left: 50px; }
}
.shove:hover span
{
-webkit-animation: shove 0.8s;
-webkit-animation-fill-mode: forwards;
}
Here is a JSFiddle to take a look at.