CSS3: reverse animation on mouse out after hover -
so, possible have reverse animation on mouse out such as:
.class{ transform: rotate(0deg); } .class:hover{ transform: rotate(360deg); }
but, when using @keyframes animation, couldn't work, e.g:
.class{ animation-name: out; animation-duration:2s; } .class:hover{ animation-name: in; animation-duration:5s; animation-iteration-count:infinite; } @keyframe in{ {transform: rotate(360deg);} } @keyframe out{ {transform: rotate(0deg);} }
so optimal solution, knowing i'd need iterations , animation itself...
thanks
i think if have to
, must use from
. think of :
@keyframe in { from: transform: rotate(0deg); to: transform: rotate(360deg); } @keyframe out { from: transform: rotate(360deg); to: transform: rotate(0deg); }
of course must have checked already, found strange use transform
property since css3 not implemented everywhere. maybe work better following considerations :
- chrome uses
@-webkit-keyframes
, no particuliar version needed - safari uses
@-webkit-keyframes
since version 5+ - firefox uses
@keyframes
since version 16 (v5-15 used@-moz-keyframes
) - opera uses
@-webkit-keyframes
version 15-22 (only v12 used@-o-keyframes
) - internet explorer uses
@keyframes
since version 10+
edit :
i came fiddle :
using minimal code. approaching expecting ?
Comments
Post a Comment