2015-01-07 40 views
0

我試圖與所有的瀏覽器這方面的工作,但我不能複製Firefox中的作用:我想複製這樣的代碼CSS3動畫旋轉上不工作的Firefox

http://jsfiddle.net/vq3xuafb/

誰有-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);} 
} 

另外我不知道它是否適用於Opera或IE。

回答

4

這是因爲您缺少標準前綴@keyframesanimationtransform

此外,您可以使用這種簡寫縮小您的animation語法。

animation: rotate 2s infinite cubic-bezier(0.5, 0.3, 0.9, 0.9); 

Updated Fiddle

#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>

+1

謝謝你很多!我嘗試過-moz-之前,但沒有結果:) – Lloople

+0

@Lloople - 歡迎您。 :) –