运行CSS3动画的某些部分我想它运行后转发到运行在相反的顺序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;
}
}
正确答案,但遗憾的是错误的链接。 [w3schools与W3C无关!](http://w3fools.com/)更好地链接到https://developer.mozilla.org/en-US/docs/CSS/animation-direction(更改并获取upvote :-) – Bergi 2013-04-11 17:40:42
是的,我只是想说。这是W3Schools的链接。检查网站W3Fools。但无论如何,谢谢。我会仔细看看的。 – IrfanM 2013-04-11 17:41:51
我明白我现在可以如何使用替代方法,但是我怎样才能将它应用到只有一半的动画(从100%到50%)向后运行,然后不再向前运行。 – IrfanM 2013-04-11 17:44:45