【发布时间】:2014-02-19 02:23:18
【问题描述】:
我开始使用 SVG,到目前为止一切都还好,但是当我尝试使用 CSS 做一些动画时,结果并不是我期望的那样。
我想像this Fiddle 那样旋转齿轮。
下面是我用来旋转元素的 CSS:
.gear {
-webkit-animation: rotation 2s infinite linear;
-moz-animation: rotation 2s infinite linear;
-o-animation: rotation 2s infinite linear;
animation: rotation 2s infinite linear;
}
@-webkit-keyframes rotation {
from {-webkit-transform: rotate(0deg);}
to {-webkit-transform: rotate(359deg);}
}
@-moz-keyframes rotation {
from {-moz-transform: rotate(0deg);}
to {-moz-transform: rotate(359deg);}
}
@-o-keyframes rotation {
from {-o-transform: rotate(0deg);}
to {-o-transform: rotate(359deg);}
}
@keyframes rotation {
from {transform: rotate(0deg);}
to {transform: rotate(359deg);}
}
【问题讨论】:
-
你的问题到底是什么?
-
我想从 svg 旋转齿轮,就像从 img @JoshC 旋转齿轮