Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style animationPlayState Property

Style animationPlayState Property

Style Object Reference The Style object

Example

Pause an animation:

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

Try it »


Definition and Usage

The animationPlayState property specifies whether the 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 an alternative to this property, namely 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"

Attribute values

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

Technical Details

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

Related Articles

CSS Reference Manual:animation-play-state Property


Style Object Reference The Style object