一旦アニメーションを再生した後、逆再生します:
div {
-webkit-animation-direction: alternate; /* Chrome, Safari,
Opera */
animation-direction: alternate;
}
Try it Yourself ❯
animation-direction プロパティは、アニメーションを交互に反転再生させるかどうかを定義します。
デフォルト値: | normal |
---|---|
継承: | 継承する |
アニメーション可否: | 不可。animatable を参照 |
バージョン: | CSS3 |
JavaScript 構文: | object.style.animationDirection="reverse" Try it |
表中の数字は、完全にプロパティをサポートした最初のブラウザのバージョンです。
-webkit-、-moz-、-o- の後に続く数字は、接頭辞付きで動作した最初のバージョンです。
プロパティ | |||||
---|---|---|---|---|---|
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- |
animation-direction: normal|reverse|alternate|alternate-reverse|initial|inherit;
値 | 説明 | Play it |
---|---|---|
normal | デフォルト値。アニメーションを通常方向に再生します | Play it ❯ |
reverse | アニメーションを逆方向に再生します | Play it ❯ |
alternate | アニメーションを、奇数番目(1,3,5,etc..)では通常方向に再生し、偶数番目(2,4,6,etc...)では逆方向に再生します | Play it ❯ |
alternate-reverse | アニメーションを、奇数番目(1,3,5,etc..)では逆方向に再生し、偶数番目(2,4,6,etc...)では通常方向に再生します | Play it ❯ |
initial | プロパティにデフォルト値を設定します。initial を参照 | |
inherit | このプロパティは親要素を継承します。inherit を参照 |
注: "reverse" と "alternate-reverse" は、Safari ではサポートしていません。.
CSS3 チュートリアル:CSS3 Animations
HTML DOM リファレンス:animationDirection プロパティ