Style animationPlayState Property

Style 对象参考手册Style Object

Examples

Pause an animation:

document.getElementById("myDIV").style.animationPlayState="paused";

Try it Yourself »

Definition and Usage

The animationPlayState property specifies whether an animation is running or paused.

Note:Use this property to pause an animation that is currently playing.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer 10, Firefox, and Opera support the animationPlayState property.

Safari and Chrome support another alternative property, the WebkitAnimationPlayState property.

Note:Internet Explorer 9 and earlier versions do not support the animationPlayState property.


Syntax

Return the animationPlayState property:

object.style.animationPlayState

Set the animationPlayState property:

object.style.animationPlayState="running|paused|initial|inherit"

Property Values

Value Description
running Default value. Specifies that the animation is running.
paused Specifies that the animation is paused.
initial Sets this property to its default value. Seeinitial。
inherit Inherits this property from its parent element. Seeinherit。

Technical Details

Default Value: running
Return Value: A string representing the animation-play-state property of an element.
CSS Version CSS3


Related Articles

CSS Reference Manual:animation-play-state property


Style 对象参考手册Style Object

Other Extensions