[英]CSS3 rotate animation not working on Firefox
I'm trying to make this working with all browsers, but I can't reproduce the effect in Firefox: 我正在尝试使所有浏览器都可以使用此功能,但是无法在Firefox中重现该效果:
http://jsfiddle.net/vq3xuafb/ http://jsfiddle.net/vq3xuafb/
I tried copying the code like this who have -webkit- and changing to -moz-, but not working. 我尝试过复制具有-webkit-的代码并将其更改为-moz-,但无法正常工作。
#ball_3 {
-webkit-animation-timing-function: cubic-bezier(0.5, 0.7, 0.9, 0.9);
-webkit-animation-name: rotate;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
-webkit-transform-origin: 6px 30px;
}
@-webkit-keyframes rotate {
0% {-webkit-transform: rotate(0deg) scale(1);}
100% {-webkit-transform: rotate(1440deg) scale(1);}
}
Also I don't know if it works on Opera or IE. 另外,我也不知道它是否适用于Opera或IE。
Its because you are missing the standard prefix for @keyframes
, animation
and transform
. 这是因为您缺少@keyframes
, animation
和transform
的标准前缀。
Also, you could minify your animation
syntax by using this shorthand. 另外,您可以使用此速记来简化animation
语法。
animation: rotate 2s infinite cubic-bezier(0.5, 0.3, 0.9, 0.9);
#hidder { display: block; position: fixed; width: 100%; height: 100%; top: 0; left: 0; background: grey; z-index: 99988; opacity: 0.5; } #spinner.active { display: block; } #spinner { display: block; position: fixed; height: 60px; width: 60px; top: 40%; left: 48%; z-index: 99989; } .spinner_ball { position: absolute; display: block; background-color: white; left: 24px; width: 12px; height: 12px; border-radius: 6px; } #ball_1, #ball_2, #ball_3 { -webkit-animation: rotate 2s infinite cubic-bezier(0.5, 0.3, 0.9, 0.9); animation: rotate 2s infinite cubic-bezier(0.5, 0.3, 0.9, 0.9); -webkit-transform-origin: 6px 30px; transform-origin: 6px 30px; } #ball_2 { -webkit-animation: rotate 2s infinite cubic-bezier(0.5, 0.5, 0.9, 0.9); animation: rotate 2s infinite cubic-bezier(0.5, 0.5, 0.9, 0.9); } #ball_3 { -webkit-animation: rotate 2s infinite cubic-bezier(0.5, 0.7, 0.9, 0.9); animation: rotate 2s infinite cubic-bezier(0.5, 0.7, 0.9, 0.9); } @-webkit-keyframes rotate { 0% { -webkit-transform: rotate(0deg) scale(1); } 100% { -webkit-transform: rotate(1440deg) scale(1); } } @keyframes rotate { 0% { transform: rotate(0deg) scale(1); } 100% { transform: rotate(1440deg) scale(1); } }
<div id='hidder'></div> <div id="spinner"> <span id="ball_1" class="spinner_ball"></span> <span id="ball_2" class="spinner_ball"></span> <span id="ball_3" class="spinner_ball"></span> </div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.