【发布时间】:2014-11-11 11:39:32
【问题描述】:
我正在尝试让一些(将是图像)块淡入暂停几秒钟,然后淡出....
到目前为止我已经得到它,但它似乎不想淡出,我不确定我哪里出错了。
淡出之后又出现了。
我有一个fiddle,它非常基本地显示了它。
/* Defines the animation keyframes */
@-webkit-keyframes fadein {
0% {
opacity: 0;
}
72% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@-moz-keyframes fadein {
0% {
opacity: 0;
}
72% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes fadein {
0% {
opacity: 0;
}
72% {
opacity: 0;
}
100% {
opacity: 1;
}
}
/* Defines the animation keyframes */
@-webkit-keyframes fadeOut {
0% {
opacity: 1;
}
72% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@-moz-keyframes fadeOut {
0% {
opacity: 1;
}
72% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@keyframes fadeOut {
0% {
opacity: 1;
}
72% {
opacity: 0;
}
100% {
opacity: 0;
}
}
.get{
-webkit-animation: fadein 1.9s ease-in-out 0s 1,
fadeOut 1.9s ease-in-out 5s 1 ;
-moz-animation: fadein 1.9s ease-in-out 0s 1,
fadeOut 1.9s ease-in-out 5s 1 ;
animation: fadein 1.9s ease-in-out 0s 1,
fadeOut 1.9s ease-in-out 5s 1 ;
background-color:red;
}
.give{
-webkit-animation: fadein 2.8s ease-in-out both 0s 1,
fadeOut 1.9s ease-in-out 8s 1 ; ;
-moz-animation: fadein 2.8s ease-in-out both 0s 1,
fadeOut 1.9s ease-in-out 8s 1 ;
animation: fadein 2.8s ease-in-out both 0s 1,
fadeOut 1.9s ease-in-out 8s 1 ;
background-color:green;
}
【问题讨论】:
-
将所有内容放在一个动画中并解决延迟问题
-
对不起,我才刚刚开始接触 css 动画,所以不确定你的意思?
标签: css animation css-animations