CSS animation-delay

140次阅读
没有评论

共计 680 个字符,预计需要花费 2 分钟才能阅读完成。

css animation-delay 使用说明

animation-delay 属性定义动画什么时候开始。

animation-delay 值单位可以是秒(s)或毫秒(ms)。

提示: 允许负值,-2s 使动画马上开始,但跳过 2 秒进入动画。

默认值: 0
继承: no
版本: CSS3
JavaScript 语法: object object.style.animationDelay="2s"

 

css animation-delay 语法

animation-delay: time;

 

 

描述
time 可选。定义动画开始前等待的时间,以秒或毫秒计。默认值为 0

 

css animation-delay 浏览器支持

CSS animation-delayCSS animation-delayCSS animation-delayCSS animation-delayCSS animation-delay

Internet Explorer 10, Firefox, 和 Opera 都支持 animation-delay 属性.

Safari 和 Chrome 通过私有属性 -WebKit-animation-delay 支持。.

注意: Internet Explorer 9 及更早 IE 版本不支持 animation-delay 属性。

 

css animation-delay 实例

等待两秒,然后开始动画:

animation-delay:2s;
-webkit-animation-delay:2s; /* Safari and Chrome */

在线运行

 

负值,请注意动画跳过 2 秒进入动画周期:

animation-delay: -2s /* W3C and Opera */
-moz-animation-delay: -2s /* Firefox */
-webkit-animation-delay: -2s /* Safari and Chrome */

在线运行

 

正文完