Want to share your CSS expertise with others? Apply to the MDN Fellowship by April 1! http://mzl.la/MDNFellowship

mozilla

Revision 22105 of animation-play-state

  • Revision slug: CSS/animation-play-state
  • Revision title: animation-play-state
  • Revision id: 22105
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 29 words added, 1 words removed

Revision Content

{{ CSSRef() }}

{{ draft() }}

Summary

The animation-play-state CSS property determines whether an animation is running or paused. You can query this property's value to determine whether or not the animation is currently running; in addition, you can set its value to pause and resume playback of an animation.

Note: At this time, this property is being considered for removal from the specification, since its functionality can be simulated by other means.

Resuming a paused animation will start the animation from where it left off at the time it was paused, rather than starting over from the beginning of the animation sequence.

It is often convenient to use the shorthand property {{ cssxref("animation") }} to set all animation properties at once.

  • {{ Xref_cssinitial() }}: running
  • Applies to: block-level and inline-level elements
  • {{ Xref_cssinherited() }}: no
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: as specified

Syntax

animation-play-state: running | paused [, running | paused]*

Values

running
The animation is currently playing.
paused
The animation is currently paused.

Examples

See CSS animations for examples.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{ CompatUnknown() }}

{{ CompatGeckoDesktop("5.0") }}

(as -moz-animation-play-state)

{{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}

Specifications

See also

  • CSS animations
  • {{ domxref("Events/AnimationEvent", "AnimationEvent") }}
  • {{ CSS_Reference:animation() }}

Revision Source

<p>{{ CSSRef() }}</p>
<p>{{ draft() }}</p>
<h3>Summary</h3>
<p>The <code>animation-play-state </code>CSS property determines whether an animation is running or paused. You can query this property's value to determine whether or not the animation is currently running; in addition, you can set its value to pause and resume playback of an animation.</p>
<div class="note"><strong>Note:</strong> At this time, this property is being considered for removal from the specification, since its functionality can be simulated by other means.</div>
<p>Resuming a paused animation will start the animation from where it left off at the time it was paused, rather than starting over from the beginning of the animation sequence.</p>
<p>It is often convenient to use the shorthand property {{ cssxref("animation") }} to set all animation properties at once.</p>
<ul> <li>{{ Xref_cssinitial() }}: running</li> <li>Applies to: block-level and inline-level elements</li> <li>{{ Xref_cssinherited() }}: no</li> <li>Media: {{ Xref_cssvisual() }}</li> <li>{{ Xref_csscomputed() }}: as specified</li>
</ul>
<h3>Syntax</h3>
<pre class="eval">animation-play-state: running | paused [, running | paused]*
</pre>
<h3>Values</h3>
<dl> <dt><code>running</code></dt> <dd>The animation is currently playing.</dd> <dt><code>paused</code></dt> <dd>The animation is currently paused.</dd>
</dl>
<h3>Examples</h3>
<p>See <a href="/en/CSS/CSS_animations" title="en/CSS/CSS animations">CSS animations</a> for examples.</p>
<h3 name="Browser_Compatibility">Browser compatibility</h3>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
<table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>{{ CompatUnknown() }}</td> <td> <p>{{ CompatGeckoDesktop("5.0") }}</p> <p>(as <code>-moz-animation-play-state</code>)</p> </td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> </tr> </tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> </tr> </tbody>
</table>
</div>
<h3>Specifications</h3>
<ul> <li><a class="external" href="http://www.w3.org/TR/css3-animations" title="http://www.w3.org/TR/css3-animations">CSS Animations Module Level 3</a></li>
</ul>
<h2>See also</h2>
<ul> <li><a href="/en/CSS/CSS_animations" title="en/CSS/CSS animations">CSS animations</a></li> <li>{{ domxref("Events/AnimationEvent", "AnimationEvent") }}</li> <li>{{ CSS_Reference:animation() }}</li>
</ul>
Revert to this revision