CSS动画延迟(CSS animation delay)

2019-10-20 02:24发布

我只是在我的CSS问题,我想是动画中的第一个动画10秒后启动,所以我正餐动画延迟属性,但它似乎不工作。 你能告诉我什么,我做错了什么? 谢谢。

#txteram {
    position:relative;
    top:-120px; /*-100px*/
    left: 40px;/*50px*//*200px;*/
    opacity: 0;

-webkit-transition: opacity 19s ease-in;
    -moz-transition: opacity 19s ease-in;
    -ms-transition: opacity 19s ease-in;
    -o-transition: opacity 19s ease-in;
    transition: opacity 19s ease-in;
    -webkit-transition: all 5s ease-in-out;/*19*/
    -moz-transition: all 5s ease-in-out;
    -o-transition: all 5s ease-in-out;
    /*animation delay*/
    animation-delay:15s;
    -webkit-animation-delay:15s;
}
.showtxteram #txteram {
    opacity: 1;
    transform: translate(150px,0);
    -webkit-transform: translate(150px,0);
    -o-transform: translate(150px,0); 
    -moz-transform: translate(150px,0);
}

Answer 1:

试着将延迟与过渡线:

-webkit-transition: opacity 19s ease-in, all 5s ease-in-out 15s ;
-moz-transition: opacity 19s ease-in, all 5s ease-in-out 15s ;
-ms-transition: opacity 19s ease-in, all 5s ease-in-out 15s ;
-o-transition: opacity 19s ease-in, all 5s ease-in-out 15s ;
transition: opacity 19s ease-in, all 5s ease-in-out 15s ;


Answer 2:

由于您使用的是过渡您需要的属性是事实transition-delay ,我已经创建了演示的工作版本,这里的小提琴: http://jsfiddle.net/sandro_paganotti/dhk8U/1/

-webkit-transition: opacity 1s ease-in, -webkit-transform 1s ease-in 3s;
-moz-transition: opacity 1s ease-in, -moz-transform 1s ease-in 3s;
-ms-transition: opacity 1s ease-in, -ms-transform 1s ease-in 3s;
transition: opacity 1s ease-in, transform 1s ease-in 3s;


文章来源: CSS animation delay