CSS3 animation-delay 属性

实例

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

div
{
animation-delay:2s;
-webkit-animation-delay:2s; /* Safari 和 Chrome */
}

亲自试一试

浏览器支持

Internet Explorer 10、Firefox 以及 Opera 支持 animation-delay 属性。

Safari 和 Chrome 支持替代的 -webkit-animation-delay 属性。

注释:Internet Explorer 9 以及更早的版本不支持 animation-delay 属性。

定义和用法

animation-delay 属性定义动画何时开始。

animation-delay 值以秒或毫秒计。

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

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

语法

animation-delay: time;
描述 测试
time 可选。定义动画开始前等待的时间,以秒或毫秒计。默认值是 0。 测试

亲自试一试 - 实例

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

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

亲自试一试

相关页面

CSS3 教程:CSS3 动画