スタイルアニメーションプロパティ
例
省略形のプロパティを使用して、<div>要素のアニメーションを変更します。
document.getElementById("myDIV").style.animation = "mynewmove 4s 2";
定義と使用法
アニメーションプロパティは、6つのアニメーションプロパティの省略形のプロパティです。
AnimationNameアニメーション期間
animationTimingFunctionanimationDelayanimationIterationCountanimationDirection _ _
注:常にanimationDurationプロパティを指定してください。指定しない場合、期間は0になり、再生されません。
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Webkit、Moz、またはOが後に続く数字は、プレフィックスで機能した最初のバージョンを指定します。
Property | |||||
---|---|---|---|---|---|
animation | 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 |
構文
アニメーションプロパティを返します。
object.style.animation
アニメーションプロパティを設定します。
object.style.animation = "name duration timingFunction delay iterationCount direction fillMode playState"
プロパティ値
Value | Description |
---|---|
animationName | Specifies the name of the keyframe you want to bind to the selector |
animationDuration | Specifies how many seconds or milliseconds an animation takes to complete |
animationTimingFunction | Specifies the speed curve of the animation |
animationDelay | Specifies a delay before the animation will start |
animationIterationCount | Specifies how many times an animation should be played |
animationDirection | Specifies whether or not the animation should play in reverse on alternate cycles |
animationFillMode | Specifies what values are applied by the animation outside the time it is executing |
animationPlayState | Specifies whether the animation is running or paused |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
技術的な詳細
デフォルト値: | なし0イーズ01通常なし実行中 |
---|---|
戻り値: | 要素のアニメーションプロパティを表す文字列 |
CSSバージョン | CSS3 |
関連ページ
CSSリファレンス:アニメーションプロパティ