某些CSS3动画无法在Firefox和IE中运行

时间:2014-05-10 23:11:43

标签: html css css3 firefox

我的一些动画有效,有些则没有。它们在Chrome中都运行良好。这是不起作用的那个:

.orbit {
position: absolute;
height: 810px;
width: 810px;
top: 50px;
left: 200px;

border-radius: 8%;
border:0px solid red;

margin-left: -100px;
margin-top: -100px;

-webkit-animation-duration: 160s;
-webkit-animation-timing-function: linear;
-webkit-animation-delay: 0s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-name: spinleft;

-moz-animation-duration: 160s;
-moz-animation-timing-function: linear;
-moz-animation-delay: 0s;
-moz-animation-iteration-count: infinite;
-moz-animation-name: spinleft;

animation: spinleft 160s linear 0s infinite;
}

@-webkit-keyframes spinleft {
    100% {
        -webkit-transform: rotate(-360deg);
    }
}

@-moz-keyframes spinleft {
    100% {
        -webkit-transform: rotate(-360deg);
    }
}

@keyframes spinleft {
    100% {
        -webkit-transform: rotate(-360deg);
    }
}

我已经尝试了一百万种布局动画的组合,但它们只是不起作用。奇怪的是,这些动画确实有效:

.charanimate{
-webkit-animation-delay: 0s;
-webkit-animation-duration: 3s; 
-webkit-animation-name: appear;
-webkit-animation-fill-mode: forwards;

-moz-animation-delay: 0s;
-moz-animation-duration: 3s; 
-moz-animation-name: appear;
-moz-animation-fill-mode: forwards;

animation-delay: 0s;
animation-duration: 3s; 
animation-name: appear;
animation-fill-mode: forwards;

}

@-webkit-keyframes appear { 
 from { 
    left: -240px; 
    top: 465px; 
 } 
 70%{
    left:50px;
 }
 to { 
    top:465px;
    left: 35px;
 } 
} 

@-moz-keyframes appear { 
 from { 
    left: -240px; 
    top: 465px; 
 } 
 70%{
    left:50px;
 }
 to { 
    top:465px;
    left: 35px;
 } 
} 

@keyframes appear { 
 from { 
    left: -240px; 
    top: 465px; 
 } 
 70%{
    left:50px;
 }
 to { 
    top:465px;
    left: 35px;
 } 
}

1 个答案:

答案 0 :(得分:3)

可能会将-webkit-前缀更改为-moz-

@-moz-keyframes spinleft {
    100% {
        -webkit-transform: rotate(-360deg);
    }
}

并在此处删除-webkit-前缀,因此改为transform: rotate(-360deg);

@keyframes spinleft {
    100% {
        -webkit-transform: rotate(-360deg);
    }
}