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

http://jsfiddle.net/khalednabil/ewzbm/

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 :

http://jsfiddle.net/jjhng/35/

using minimal code. approaching expecting ?


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -