トップページ  > CSS3  > transition-delay

★CSS3リファレンス

transition-delay …… 変化がいつ始まるかを指定する
Firefox4(-moz-) Google Chrome2(-webkit-)Google Chrome3(-webkit-)Google Chrome4(-webkit-)Google Chrome5(-webkit-) Safari4(-webkit-)Safari5(-webkit-)
広告

transition-delayプロパティは、変化がいつ始まるかを指定する際に使用します。

transition-delayプロパティの値には、時間を指定しますが、その指定時間が経過した後に変化が開始されます。 初期値は0ですが、これは変化がすぐに開始されることを意味します。

値に負の時間を指定すると、変化はすぐに開始されますが、指定した時間をさかのぼって実行を開始したような表示になります。 transition-durationプロパティ(変化に掛かる時間)との組み合わせによっては、変化再生サイクルの途中から変化が開始されるでしょう。

■値

時間
変化が始まる時間を指定(初期値は0)

■初期値・適用対象・値の継承

初期値
0
適用対象
すべての要素、:before擬似要素、:after擬似要素
値の継承
しない

■使用例

CSSソースは外部ファイル(sample.css)に記述

div.sample {
background-color:blue; width:200px; height:50px;
transition-property: background-color, width, height;
transition-duration:1s;
transition-timing-function:ease-in-out;
transition-delay:3s;
}

div.sample:hover {
background-color:aqua; width:300px; height:100px;
}

HTMLソース

<html>
<head>
<link rel="stylesheet" href="sample.css" type="text/css">
</head>
<body>
<div class="sample">transitionの使用例</div>
</body>
</html>
↓↓↓

ブラウザ上の表示

transitionの使用例

■ベンダープレフィックスを付けた場合の使用例

CSSソースは外部ファイル(sample.css)に記述

div.prefix_sample {
background-color:blue; width:200px; height:50px;

-moz-transition-property: background-color, width, height;
-webkit-transition-property: background-color, width, height;
-o-transition-property: background-color, width, height;
-ms-transition-property: background-color, width, height;

-moz-transition-duration:1s;
-webkit-transition-duration:1s;
-o-transition-duration:1s;
-ms-transition-duration:1s;

-moz-transition-timing-function:ease-in-out;
-webkit-transition-timing-function:ease-in-out;
-o-transition-timing-function:ease-in-out;
-ms-transition-timing-function:ease-in-out;

-moz-transition-delay:3s;
-webkit-transition-delay:3s;
-o-transition-delay:3s;
-ms-transition-delay:3s;
}

div.prefix_sample:hover {
background-color:aqua; width:300px; height:100px;
}

HTMLソース

<html>
<head>
<link rel="stylesheet" href="sample.css" type="text/css">
</head>
<body>
<div class="prefix_sample">transitionの使用例</div>
</body>
</html>
↓↓↓

ブラウザ上の表示

transitionの使用例
広告
Sponsors
広告
MuuMuu Domain!
ドメイン取るならお名前.com
現役エンジニアのオンライン家庭教師【CodeCamp】
サイトに広告を掲載してお小遣いが稼げる!【A8.net】
Node.jsコース
はじめてのプログラミングコース
▲ページ先頭へ
HTMLクイックリファレンスについて
© HTMQ