2012-03-04 2 views
4

要素を無限に360度回転させたいと思います。以下は私のコードです:CSSはWebkitでのみ動作するアニメーションを回転します

.rotate-animation { 
    -webkit-animation: rotate 2s linear 0 infinite normal; 
    -moz-animation: rotate 2s linear 0 infinite normal; 
    -o-animation: rotate 2s linear 0 infinite normal; 
    -ms-animation: rotate 2s linear 0 infinite normal; 
    animation: rotate 2s linear 0 infinite normal; 
} 

@-webkit-keyframes rotate { 
    from { 
    -webkit-transform: rotate(0deg); 

    } 
    to { 
    -webkit-transform: rotate(360deg); 
    } 
} 

@-moz-keyframes rotate { 
    from { 
    -moz-transform: rotate(0deg); 

    } 
    to { 
    -moz-transform: rotate(360deg); 
    } 
} 

@-o-keyframes rotate { 
    from { 
    -o-transform: rotate(0deg); 

    } 
    to { 
    -o-transform: rotate(360deg); 
    } 
} 

@-ms-keyframes rotate { 
    from { 
    -ms-transform: rotate(0deg); 

    } 
    to { 
    -ms-transform: rotate(360deg); 
    } 
} 

@keyframes rotate { 
    from { 
    transform: rotate(0deg); 

    } 
    to { 
    transform: rotate(360deg); 
    } 
} 

これはWebkitブラウザでのみ動作します。私は間違って何をしていますか?

答えて

5

ゼロを含む秒も定義する必要があります。0sこのように:代わりにこの

-moz-animation: rotate 2s linear 0 infinite normal; 

チェックの

-moz-animation: rotate 2s linear 0s infinite normal; 

より安全性のための目的で、このhttp://jsfiddle.net/srxzF/2/

+0

これは正しい動作です。 https://bugzilla.mozilla.org/show_bug.cgi?id=653999 – Manish

0

は、より良い一品はすべての場合に付きライト秒です。

rotate 2s linear 0s infinite normal; 
関連する問題