mozilla

Revision 493419 of animation-play-state

  • Revision slug: Web/CSS/animation-play-state
  • Revision title: animation-play-state
  • Revision id: 493419
  • Created:
  • Creator: kscarfone
  • Is current revision? No
  • Comment Updated tags

Revision Content

{{CSSRef}}
{{SeeCompatTable}}

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.

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.

{{cssbox("animation-play-state")}}

Syntax

Formal syntax: {{csssyntax("animation-play-state")}}
animation-play-state: running
animation-play-state: paused

animation-play-state: paused, running, running

Values

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

Examples

See CSS animations for examples.

Specifications

Specification Status Comment
{{SpecName('CSS3 Animations', '#animation-play-state', 'animation-play-state')}} {{Spec2('CSS3 Animations')}}  

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{CompatVersionUnknown}}{{property_prefix("-webkit")}} {{CompatGeckoDesktop("5.0")}}{{property_prefix("-moz")}}
{{CompatGeckoDesktop("16.0")}}
10 12 {{property_prefix("-o")}}
12.10 #
{{CompatVersionUnknown}}{{property_prefix("-webkit")}}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}}{{property_prefix("-webkit")}} {{CompatGeckoMobile("5.0")}}{{property_prefix("-moz")}}
{{CompatGeckoMobile("16.0")}}
{{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}

See also

Revision Source

<div>
 {{CSSRef}}</div>
<div>
 {{SeeCompatTable}}</div>
<h2 id="Summary">Summary</h2>
<p>The <code>animation-play-state</code> <a href="/en-US/docs/CSS" title="CSS">CSS</a> 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>
<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>{{cssbox("animation-play-state")}}</p>
<h2 id="Syntax">Syntax</h2>
<pre class="twopartsyntaxbox">
<a href="/en-US/docs/CSS/Value_definition_syntax" title="/en-US/docs/CSS/Value_definition_syntax">Formal syntax</a>: <code>{{csssyntax("animation-play-state")}}</code>
</pre>
<pre>
animation-play-state: running
animation-play-state: paused

animation-play-state: paused, running, running
</pre>
<h3 id="Values">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>
<h2 id="Examples">Examples</h2>
<p>See <a href="/en-US/docs/CSS/CSS_animations" title="CSS/CSS_animations">CSS animations</a> for examples.</p>
<h2 id="Specifications" name="Specifications">Specifications</h2>
<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS3 Animations', '#animation-play-state', 'animation-play-state')}}</td>
   <td>{{Spec2('CSS3 Animations')}}</td>
   <td>&nbsp;</td>
  </tr>
 </tbody>
</table>
<h2 id="Browser_Compatibility" name="Browser_Compatibility">Browser compatibility</h2>
<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>{{CompatVersionUnknown}}{{property_prefix("-webkit")}}</td>
    <td>{{CompatGeckoDesktop("5.0")}}{{property_prefix("-moz")}}<br />
     {{CompatGeckoDesktop("16.0")}}</td>
    <td>10</td>
    <td>12 {{property_prefix("-o")}}<br />
     12.10 <a href="http://my.opera.com/ODIN/blog/2012/08/03/a-hot-opera-12-50-summer-time-snapshot" title="http://my.opera.com/ODIN/blog/2012/08/03/a-hot-opera-12-50-summer-time-snapshot">#</a></td>
    <td>{{CompatVersionUnknown}}{{property_prefix("-webkit")}}</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>{{CompatVersionUnknown}}{{property_prefix("-webkit")}}</td>
    <td>{{CompatGeckoMobile("5.0")}}{{property_prefix("-moz")}}<br />
     {{CompatGeckoMobile("16.0")}}</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatUnknown}}</td>
   </tr>
  </tbody>
 </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
 <li><a href="/en-US/docs/CSS/Tutorials/Using_CSS_animations" title="Tutorial about CSS animations">Using CSS animations</a></li>
 <li>{{domxref("AnimationEvent", "AnimationEvent")}}</li>
 <li>{{CSS_Reference:animation}}</li>
</ul>
Revert to this revision