2013-11-26 173 views

回答

7

研究我找到了我的問題的答案。我們需要爲-webkit-transform CSS屬性使用rotateY屬性。

.imageRotateHorizontal{ 
    -moz-animation: spinHorizontal .8s infinite linear; 
    -o-animation: spinHorizontal .8s infinite linear;  
    -webkit-animation: spinHorizontal .8s infinite linear; 
    animation: spinHorizontal .8s infinite linear; 
} 

@keyframes spinHorizontal { 
    0% { transform: rotateY(0deg); } 
    100% { transform: rotateY(360deg); } 
} 

/* Vendor specific keyframes go here */ 

此外,我們必須定義一個合理時間的動畫。例如,我要將動畫設置爲0.8秒。這意味着我們的圖像將每0.8秒執行一次完整的旋轉。

我已經準備了的jsfiddle示出的完整代碼寬度的示例:http://jsfiddle.net/AB277/7/

+0

'-webkit-transform'內部'-moz-keyframes'?看起來你不完全明白你在做什麼。標準屬性在哪裏? – Pavlo

+0

你是對的@Pavlo。這是一個錯誤的複製和粘貼在匆忙的早晨。對不起,並感謝您的意見。 –

+0

謝謝@PabloAnaya發佈這個答案並提供jsfiddle! – ComeOn