Note that there are some explanatory texts on larger screens.

plurals
  1. POWebkit animation stop and reverse
    primarykey
    data
    text
    <p>I'm having a little trouble with Webkit animations. I want the animation to play one way when a user rolls over, and the other way when they roll out. Simple no? Apparently not for me.</p> <p><a href="http://jsfiddle.net/hornerlas/xFhkm/16/" rel="nofollow">http://jsfiddle.net/hornerlas/xFhkm/16/</a> - Here is the fiddle.</p> <p>Obviously I did a bit of digging and found the little minx they call fill-mode. weirdly -webkit-animation-fill-mode: forwards; isn't working for me. I know there are a few questions already out there about this, but i wouldn't post it if i found a good one.</p> <p>I'd rather not tackle this in JS but it seems like the obvious workaround at this point.</p> <p>Thanks everybody, if you'd rather just see the code... here it is.</p> <p>CSS</p> <pre><code> .hi { width: 171px; height: 171px; background-image: url([URL]); -webkit-animation: play .3s steps(6) 1; -moz-animation: play .3s steps(6) 1; -ms-animation: play .3s steps(6) 1; -o-animation: play .3s steps(6) 1; animation: play .3s steps(6) 1; } .hi:hover { -webkit-animation-play-state:running; -webkit-animation-direction: reverse; } @-webkit-keyframes play { from { background-position: 0px; } to { background-position: -1026px; } } @-moz-keyframes play { from { background-position: 0px; } to { background-position: -1026px; } } @-ms-keyframes play { from { background-position: 0px; } to { background-position: -1026px; } } @-o-keyframes play { from { background-position: 0px; } to { background-position: -1026px; } } </code></pre> <p>HTML</p> <pre><code>&lt;div class="hi"&gt;&lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload