--- title: animation-play-state slug: Web/CSS/animation-play-state translation_of: Web/CSS/animation-play-state ---
animation-play-state
CSS 属性定义一个动画是否运行或者暂停。可以通过查询它来确定动画是否正在运行。另外,它的值可以被设置为暂停和恢复的动画的重放。
恢复一个已暂停的动画,将从它开始暂停的时候,而不是从动画序列的起点开始在动画。
{{cssinfo}}
/* Single animation */ animation-play-state: running; animation-play-state: paused; /* Multiple animations */ animation-play-state: paused, running, running; /* Global values */ animation-play-state: inherit; animation-play-state: initial; animation-play-state: unset;
running
paused
{{csssyntax}}
参见实例CSS animations
规范 | 状态 | 备注 |
---|---|---|
{{SpecName('CSS3 Animations', '#animation-play-state', 'animation-play-state')}} | {{Spec2('CSS3 Animations')}} | Initial definition |
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}}{{property_prefix("-webkit")}} {{CompatChrome(43.0)}} |
{{CompatGeckoDesktop("5.0")}}{{property_prefix("-moz")}} {{CompatGeckoDesktop("16.0")}} |
10 | 12 {{property_prefix("-o")}} 12.10 |
{{CompatVersionUnknown}}{{property_prefix("-webkit")}} |
Feature | Android | Chrome | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |