animation

英[??n??me??n] 美[??n??me??n]

n. 怒っている、活発、漫畫制作、漫畫撮影、[映畫とテレビ] アニメーション

複數(shù)形: animes

direction

英[d??rek?n] 美[d??r?k??n, da?-]

n. 方向、傾向、側(cè)面; 使用方法

複數(shù)形: 指示

css animation-direction屬性 構(gòu)文

アニメーション方向?qū)傩预蚴褂盲工毪摔悉嗓Δ工欷肖瑜い扦工?

アニメーションの方向?qū)傩预?、アニメーションを順番に逆方向に再生するかどうかを定義するために使用されます。アニメーションが複數(shù)回再生される場(chǎng)合、アニメーションの値を設(shè)定することでアニメーションの順番を?qū)g現(xiàn)できます。 -方向を交互に切り替えます。逆方向に再生します。

関數(shù): アニメーションを順番に逆方向に再生するかどうかを定義します。

構(gòu)文: animation-direction:normal|alternate;

##説明: normal デフォルト値。アニメーションは正常に再生されるはずです。代替アニメーションは順番に逆になります。

注: アニメーションが 1 回だけ再生されるように設(shè)定されている場(chǎng)合、この屬性は効果がありません。

css animation-direction屬性 例

<!DOCTYPE html>
<html>
<head>
<style> 
div
{
width:100px;
height:100px;
background:red;
position:relative;
animation:myfirst 5s infinite;
animation-direction:alternate;

/* Safari and Chrome */
-webkit-animation:myfirst 5s infinite;
-webkit-animation-direction:alternate;
}

@keyframes myfirst
{
0%   {background:red; left:0px; top:0px;}
25%  {background:yellow; left:200px; top:0px;}
50%  {background:blue; left:200px; top:200px;}
75%  {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}

@-webkit-keyframes myfirst /* Safari and Chrome */
{
0%   {background:red; left:0px; top:0px;}
25%  {background:yellow; left:200px; top:0px;}
50%  {background:blue; left:200px; top:200px;}
75%  {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}
</style>
</head>
<body>

<p><strong>注釋:</strong>Internet Explorer 9 以及更早的版本不支持 animation-direction 屬性。</p>

<div></div>

</body>
</html>

インスタンスの実行 ?

[インスタンスの実行] ボタンをクリックしてオンライン インスタンスを表示します