【问题标题】:css animations webkit issuecss动画webkit问题
【发布时间】:2013-03-18 19:59:08
【问题描述】:

我已经使用 css 动画创建了一个 3d 旋转立方体,它在 Mozilla 中运行良好,但是当我在 webkit 浏览器中运行它时,我有旋转动画,但 6 个图像没有按应有的方式翻译。但是,如果我禁用动画,则 6 个图像会按要求翻译,并且我有一个立方体。有没有人遇到过这种情况?

@-webkit-keyframes rotate{
from {-webkit-transform: rotateX(0deg) rotateZ(0deg);}
to {-webkit-transform: rotateX(360deg) rotateZ(360deg);}
}
@-moz-keyframes rotate{
from {-moz-transform: rotateX(0deg) rotateZ(0deg);}
to {-moz-transform: rotateX(360deg) rotateZ(360deg);}
}

.object{
transform-style:preserve-3d;
width:300px;
height:300px;
top: 150px;
margin:0 auto;
position:absolute;
-moz-animation-name:                rotate; 
-moz-animation-duration:            5s; 
-moz-animation-iteration-count:     infinite;
-moz-animation-timing-function:     linear;
-webkit-animation-name:             rotate; 
-webkit-animation-duration:         5s; 
-webkit-animation-iteration-count:  infinite;
-webkit-animation-timing-function:  linear;}

这是一个立方体的 jsfiddle http://jsfiddle.net/timwilks13/SRU34/1/ 和托管版本http://www.bettondesignwork.co.uk/tim/css

【问题讨论】:

    标签: html css css-animations


    【解决方案1】:

    添加:

    .object{
        transform-style: preserve-3d;
        -webkit-transform-style: preserve-3d;
        /* ..*/
    }
    

    Updated fiddle

    【讨论】:

      猜你喜欢
      • 2013-09-15
      • 2015-08-09
      • 2011-12-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-12
      • 1970-01-01
      • 2014-04-19
      相关资源
      最近更新 更多