亚洲区国产区激情区无码区,国产成人mv视频在线观看,国产A毛片AAAAAA,亚洲精品国产首次亮相在线

CSS 參考手冊(cè)

CSS @規(guī)則(RULES)

CSS 屬性大全

CSS3 animation-delay 屬性使用方法及示例

 CSS animation-delay屬性定義了動(dòng)畫何時(shí)開始播放(例如:值為2s,表示動(dòng)畫將在應(yīng)用后2秒開始播放)。 此屬性的值可以以秒(s)或毫秒(ms)為單位指定。

下表總結(jié)了此屬性的用法上下文和版本歷史記錄。

默認(rèn)值:0s
適用于:所有元素::before和::after 偽元素
繼承:沒有
可動(dòng)畫制作:否。請(qǐng)參見 動(dòng)畫屬性。
版本: CSS3的新功能
JavaScript 語法:    object    object.style.animationDelay="2s"

animation-delay的使用語法

該屬性的語法如下:

animation-delay: time | initial | inherit

下面的示例演示了如何使用animation-delay屬性。

.box {
    width: 50px;
    height: 50px;
    background: red;
    position: relative;
    /* Chrome, Safari, Opera */
    -webkit-animation-name: moveit;
    -webkit-animation-duration: 4s;
    -webkit-animation-delay: 2s;
    
    animation-name: moveit;
    animation-duration: 4s;
    animation-delay: 2s;
}
 
/* Chrome, Safari, Opera */
@-webkit-keyframes moveit {
    from {left: 0;}
    to {left: 50%;}
}
 

@keyframes moveit {
    from {left: 0;}
    to {left: 50%;}
}
測(cè)試看看?/?

注意:此屬性允許使用負(fù)值。但是,它似乎已開始在其動(dòng)畫周期的中途執(zhí)行,例如-2s的動(dòng)畫延遲使動(dòng)畫立即開始,但在動(dòng)畫開始2秒后開始執(zhí)行。

屬性值

下表描述了此屬性的值。

描述
time定義動(dòng)畫開始之前要等待的秒數(shù)或毫秒數(shù)。默認(rèn)值為0s。
initial將此屬性設(shè)置為其默認(rèn)值。
inherit如果指定,則關(guān)聯(lián)元素采用其父元素animation-delay屬性的計(jì)算值。

瀏覽器兼容性

animation-delay屬性瀏覽器的兼容性,所有主流瀏覽器均支持該屬性。

Browsers Icon
  • Firefox 5+ -moz-,15 +

  • Google Chrome 4+ -webkit-

  • Internet Explorer 10+

  • Apple Safari 4+ -webkit-

  • Opera 12+ -o-, 15+ -webkit-

進(jìn)一步閱讀

請(qǐng)參考以下教程:CSS3動(dòng)畫。

相關(guān)屬性和規(guī)則:animation,animation-nameanimation-duration,animation-timing-function,animation-iteration-count,animation-direction,animation-fill-mode,animation-play-state@keyframes。