CSSアニメーション-方向プロパティ
例
最初にアニメーションを順方向に再生し、次に逆方向に再生します。
div {
animation-direction: alternate;
}
以下の「自分で試してみてください」の例をもっと見てください。
定義と使用法
このanimation-direction
プロパティは、アニメーションを順方向、逆方向、または交互のサイクルで再生するかどうかを定義します。
デフォルト値: | 正常 |
---|---|
遺伝性の: | いいえ |
アニメート可能: | 番号。アニメート可能について読む |
バージョン: | CSS3 |
JavaScript構文: | オブジェクト.style.animationDirection = "reverse" |
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
数字の後に-webkit-、-moz-、または-o-が続く場合は、プレフィックスを使用して機能した最初のバージョンを指定します。
Property | |||||
---|---|---|---|---|---|
animation-direction | 43.0 4.0 -webkit- |
10.0 | 16.0 5.0 -moz- |
9.0 4.0 -webkit- |
30.0 15.0 -webkit- 12.0 -o- |
CSS構文
animation-direction: normal|reverse|alternate|alternate-reverse|initial|inherit;
プロパティ値
Value | Description | Play it |
---|---|---|
normal | Default value. The animation is played as normal (forwards) | |
reverse | The animation is played in reverse direction (backwards) | |
alternate | The animation is played forwards first, then backwards | |
alternate-reverse | The animation is played backwards first, then forwards | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
その他の例
例
最初にアニメーションを逆方向に再生し、次に順方向に再生します。
div {
animation-direction: alternate-reverse;
}
例
アニメーションを逆方向に再生します。
div {
animation-direction: reverse;
}
関連ページ
CSSチュートリアル:CSSアニメーション
HTML DOMリファレンス:animationDirectionプロパティ