2012-09-04 47 views
22

Tôi có một hoạt ảnh nhỏ đang hoạt động trong firefox, nhưng không hoạt động trong trình duyệt webkit. Có thể ai đó thấy nguyên nhân sai lầm tôi đã tìm kiếm một giờ ... Đó là một phần của bản trình bày impress.js, tương tự như prezi. Cảm ơn!hoạt ảnh css3 không hoạt động trong chrome

css:

#its.step.present h5{ 

display: inline-block; 
position:absolute; 




animation: aia2 5s linear infinite alternate; 
-moz-animation: aia2 5s linear infinite alternate; 
-webkit-animation: aia2 5s linear infinite alternate; 
-ms-animation: aia2 5s linear infinite alternate; 
-o-animation: aia2 5s linear infinite alternate; 

-moz-animation-delay: 4s; 
-webkit-animation-delay: 4s; 
-ms-animation-delay: 4s; 
-o-animation-delay: 4s; 
animation-delay: 4s; 


} 
@-moz-keyframes aia2{ 
    0%{ 

     left:120px; 
     -moz-transform:scale(1) rotate(0deg); 
     -webkit-transform:scale(1) rotate(0deg); 
     -ms-transform:scale(1) rotate(0deg); 
     -o-transform:scale(1) rotate(0deg); 
     transform:scale(1) rotate(0deg); 

     color: red; 
    } 
    90%{ 
     left: 580px; 

     -moz-transform:scale(1) rotate(2000deg); 
     -webkit-transform:scale(1) rotate(2000deg); 
     -ms-transform:scale(1) rotate(2000deg); 
     -o-transform:scale(1) rotate(2000deg); 
     transform:scale(1) rotate(2000deg); 

    } 
    100%{ 
     left: 580px; 


    } 
} 

html:

<div id="its" class="step" data-x="850" data-y="3000" data-rotate="90" data-scale="5"> 
     <p> 
      <ul> 
       <li>Web Development,</li> 
       <li>Web Design,</li> 
       <li>Log<h5>o</h5>&nbsp;&nbsp; Design,</li> 
       <li>Web Marketing,</li> 
      </ul> 

      <ul class="doua"> 
       <li><h6>e</h6>&nbsp;&nbsp;Commerce,</li> 
       <li>CMS (WP, J, D),</li> 
       <li>Cust&nbsp; m Apps</li> 
       <li>and others.</li> 
      </ul> 
     </p> 
    </div> 
+0

Nếu ai đó muốn xem hoạt hình ... http://www.messagelab.ro/pages/Presentation.html#/its Các o và e nên di chuyển, như trong firefox ... –

+2

bạn có ' @ -webkit-keyframes aia2 {'quy tắc cho Chrome? –

+0

điểm tốt :) vì vậy nó là dư thừa để viết bên trong -moz-keyframes {-webkit-transform ..}? –

Trả lời

53

Bạn phải đặt sự cai trị hoạt hình nói chung sau khi những người cụ thể trình duyệt:

-webkit-animation: aia2 5s linear infinite alternate; 
    -moz-animation: aia2 5s linear infinite alternate; 
    -ms-animation: aia2 5s linear infinite alternate; 
    -o-animation: aia2 5s linear infinite alternate; 
     animation: aia2 5s linear infinite alternate; /* this comes last */ 

Và kể từ khi bạn có -webkit-animation: aia2 , -moz-animation: aia2 et . C bạn phải thiết lập các hình ảnh động cho mỗi trình duyệt như:

@-moz-keyframes aia2{ 
    ... 
} 

@-webkit-keyframes aia2{ 
    ... 
} 
@-o-keyframes aia2{ 
    ... 
} 
+0

yea, nó hoạt động ngay bây giờ! cảm ơn! –

+1

bạn được chào đón :) –

5

Chrome v43 giảm tiền tố -webkit- cho phim hoạt hình vì vậy nếu làm việc này trước đây nhưng không phải bây giờ, có lẽ đó là lý do tại sao.

Các vấn đề liên quan