简体   繁体   English

图像没有旋转

[英]The image is not spinning

I followed the explanations on this jsFiddle page http://jsfiddle.net/gionaf/Ugc5g/ to spin an image on my page http://www.prezzio.net/ but it does not work: the image is not spinning. 我按照jsFiddle页面http://jsfiddle.net/gionaf/Ugc5g/上的说明在页面http://www.prezzio.net/上旋转图像,但是它不起作用:图像没有旋转。

To be clear, here is the image to spin: 要清楚,这是要旋转的图像:

在此处输入图片说明

Here is the original code: 这是原始代码:

  .spin { position: absolute; top: 50%; left: 50%; width: 120px; height: 120px; margin:-60px 0 0 -60px; -webkit-animation:spin 4s linear infinite; -moz-animation:spin 4s linear infinite; animation:spin 4s linear infinite; } @-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } } @-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } } @keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } } 
  <img class="spin" src="http://makeameme.org/media/templates/120/grumpy_cat.jpg" alt="" width="120" height="120"> 

Any idea ? 任何想法 ? Thanks. 谢谢。

Try this, here is Demo with all Vendor prefixes 试试看,这是带有所有Vendor prefixes Demo

 img { animation: 2s spin infinite linear; } @keyframes spin { to {transform: rotate(360deg);} } 
 <img src="http://www.prezzio.net/files/theme/spin.png" alt=""> 

The culprit lies in your main_style.css line 369 . 罪魁祸首在您的main_style.css369

Add these lines, 添加这些行,

@-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } }
@-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } }
@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }

And it should spin as you expect. 而且它应该如您所愿旋转。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM