我正在尝试在CSS3动画运行后将某个部分以相反的顺序运行。
我想要的部分是从50%到100%的关键帧,它们在前进后需要倒序。
我有5个动画按顺序进行fallA,fallB,fallC,fallD和fallE,然后在fallE完成后,我需要它转换为fallE,fallD,fallC,fallB和fallA;但是,只到它所在的100%的50%关键帧。
是否有一种方法可以使用CSS甚至javascript / jquery实现此操作?
以下是动画代码:
.animated.fallA{
-moz-animation: fallA 1s forwards ease-in-out;
-webkit-animation: fallA 1s forwards ease-in-out;
animation: fallA 1s forwards ease-in-out;
}
.animated.fallB{
-moz-animation: fallB 1.2s forwards ease-in-out;
-webkit-animation: fallB 1.2s forwards ease-in-out;
animation: fallB 1.2s forwards ease-in-out;
}
.animated.fallC{
-moz-animation: fallC 1.4s forwards ease-in-out;
-webkit-animation: fallC 1.4s forwards ease-in-out;
animation: fallC 1.4s fowards ease-in-out;
}
.animated.fallD{
-moz-animation: fallD 1.6s forwards ease-in-out;
-webkit-animation: fallD 1.6s forwards ease-in-out;
animation: fallD 1.6s forwards ease-in-out;
}
.animated.fallE{
-moz-animation: fallE 1.8s forwards ease-in-out;
-webkit-animation: fallE 1.8s forwards ease-in-out;
animation: fallE 1.8s forwards ease-in-out;
}
@-moz-keyframes fallA{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
50%{
opacity:1.0;
top:0;
}
100%{
top:0;
}
}
@-webkit-keyframes fallA{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
50%{
opacity:1.0;
top:0;
}
100%{
top:0;
}
}
@keyframes fallA{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
50%{
opacity:1.0;
top:0;
}
100%{
top:0;
}
}
@-moz-keyframes fallB{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
50%{
opacity:1.0;
top:0;
}
100%{
top:-20px;
}
}
@-webkit-keyframes fallB{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
50%{
opacity:1.0;
top:0;
}
100%{
top:-20px;
}
}
@keyframes fallB{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
50%{
opacity:1.0;
top:0;
}
100%{
top:-20px;
}
}
@-moz-keyframes fallC{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
50%{
opacity:1.0;
top:0;
}
100%{
top:-30px;
}
}
@-webkit-keyframes fallC{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
50%{
opacity:1.0;
top:0;
}
100%{
top:-30px;
}
}
@keyframes fallC{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
50%{
opacity:1.0;
top:0;
}
100%{
top:-30px;
}
}
@-moz-keyframes fallD{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
50%{
opacity:1.0;
top:0;
}
100%{
top:-20px;
}
}
@-webkit-keyframes fallD{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
50%{
opacity:1.0;
top:0;
}
100%{
top:-20px;
}
}
@keyframes fallD{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
50%{
opacity:1.0;
top:0;
}
100%{
top:-20px;
}
}
@-moz-keyframes fallE{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
50%{
opacity:1.0;
top:0;
}
100%{
top:0;
}
}
@-webkit-keyframes fallE{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
50%{
opacity:1.0;
top:0;
}
100%{
top:0;
}
}
@keyframes fallE{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
50%{
opacity:1.0;
top:0;
}
100%{
top:0;
}
}