スタイルanimationPlayStateプロパティ
例
アニメーションの一時停止:
document.getElementById("myDIV").style.animationPlayState = "paused";
定義と使用法
AnimationPlayStateプロパティは、アニメーションを実行するか一時停止するかを指定します。
注:このプロパティを使用して、サイクルの途中でアニメーションを一時停止します。
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Webkit、Moz、またはOが後に続く数字は、プレフィックスで機能した最初のバージョンを指定します。
Property | |||||
---|---|---|---|---|---|
animationPlayState | 43.0 4.0 Webkit |
10.0 | 16.0 5.0 Moz |
9.0 4.0 Webkit |
30.0 15.0 Webkit 12.1 12.0 O |
構文
AnimationPlayStateプロパティを返します。
object.style.animationPlayState
AnimationPlayStateプロパティを設定します。
object.style.animationPlayState = "running|paused|initial|inherit"
プロパティ値
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. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
技術的な詳細
デフォルト値: | ランニング |
---|---|
戻り値: | 要素のanimation-play-stateプロパティを表す文字列 |
CSSバージョン | CSS3 |
関連ページ
CSSリファレンス:animation-play-stateプロパティ