0
這是我第一次自己寫一個CSS3動畫,我剛剛打開了頁面,它沒有運行。爲什麼不這個CSS3動畫運行?
唯一的影響是動畫fallB被應用到的東西,即消失,但處於相同的位置。
動畫應用到的其他元素沒有任何反應。
我在做什麼錯?
這裏是我的代碼:
.animated{
-moz-transform: translate(0,0);
-webkit-transform: translate(0,0);
transform: translate(0,0);
-moz-transform3d: translate(0,0,0);
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
.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 1s forwards ease-in-out;
-webkit-animation: fallB 1s forwards ease-in-out;
animation: fallB 1s forwards ease-in-out;
}
.animated.fallC{
-moz-animation: fallC 1s forwards ease-in-out;
-webkit-animation: fallC 1s forwards ease-in-out;
animation: fallC 1s fowards ease-in-out;
}
.animated.fallD{
-moz-animation: fallD 1s forwards ease-in-out;
-webkit-animation: fallD 1s forwards ease-in-out;
animation: fallD 1s forwards ease-in-out;
}
.animated.fallE{
-moz-animation: fallE 1s forwards ease-in-out;
-webkit-animation: fallE 1s forwards ease-in-out;
animation: fallE 1s forwards ease-in-out;
}
@-moz-keyframes fallA{
0%{
position:relative;
opacity:0.0;
top:-300px;
left:-400px;
}
100%{
opacity:1.0;
top:0;
left:0;
}
}
@-webkit-keyframes fallA{
0%{
position:relative;
opacity:0.0;
top:-300px;
left:-400px;
}
100%{
opacity:1.0;
top:-300px;
left:-400px;
}
}
@keyframes fallA{
0%{
position:relative;
opacity:0.0;
top:-300px;
left:-400px;
}
100%{
opacity:1.0;
top:-300px;
left:-400px;
}
}
@-moz-keyframes fallB{
0%{
position:relative;
opacity:0.0;
top:-200px;
left:-200px;
}
100%{
opacity:1.0;
top:0;
left:0;
}
}
@-webkit-keyframes fallB{
0%{
position:relative;
opacity:0.0;
top:-200px;
left:-200px;
}
100%{
opacity:0.0;
top:0;
left:0;
}
}
@keyframes fallB{
0%{
position:relative;
opacity:0.0;
top:-200px;
left:-200px;
}
100%{
opacity:1.0;
top:0;
left:0;
}
}
@-moz-keyframes fallC{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
100%{
opacity:1.0;
top:0;
}
}
@-webkit-keyframes fallC{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
100%{
opacity:1.0;
top:0;
}
}
@keyframes fallC{
0%{
position:relative;
opacity:0.0;
top:-100px;
}
100%{
opacity:1.0;
top:0;
}
}
@-moz-keyframes fallD{
0%{
position:relative;
opacity:0.0;
top:-200px;
right:-200px;
}
100%{
opacity:1.0;
top:-200px;
right:-200px;
}
}
@-webkit-keyframes fallD{
0%{
position:relative;
opacity:0.0;
top:-200px;
right:-200px;
}
100%{
opacity:1.0;
top:-200px;
right:-200px;
}
}
@keyframes fallD{
0%{
position:relative;
opacity:0.0;
top:-200px;
right:-200px;
}
100%{
opacity:1.0;
top:0;
right:0;
}
}
@-moz-keyframes fallE{
0%{
position:relative;
opacity:0.0;
top:-300px;
right:-400px;
}
100%{
opacity:1.0;
top:0;
right:0;
}
}
@-webkit-keyframes fallE{
0%{
position:relative;
opacity:0.0;
top:-300px;
right:-400px;
}
100%{
opacity:1.0;
top:0;
right:0;
}
}
@keyframes fallE{
0%{
position:relative;
opacity:0.0;
top:-300px;
right:-400px;
}
100%{
opacity:1.0;
top:0;
right:0;
}
}
啊,沒關係。這就說得通了。我必須從一個價值觀到另一個價值觀的轉變。哦,0.0是一個錯字,它應該是100%的1.0。 – IrfanM 2013-04-11 07:38:17
'1.0'是你的朋友。 :)如果你隨時問自己什麼是我的關係的基礎或什麼是1% – 2013-04-11 07:48:39