1
我可以动画SVG圆圈吗?动画SVG图像
<svg>
<circle id="orange-circle" r="30" cx="50" cy="50" fill="orange" />
<animate
xlink:href="#orange-circle"
attributeName="cx"
from="50"
to="450"
dur="1s"
fill="freeze"
repeatCount="indefinite" />
</svg>
同样,我试图动画图像:
<svg>
<image id="orange-circle" x="0" y="20" width="200" height="180" xlink:href="cat.png" />
<animate
xlink:href="#orange-circle"
attributeName="cx"
from="50"
to="450"
dur="1s"
fill="freeze"
repeatCount="indefinite" />
</svg>
我怎样才能让上面的代码工作?
什么似乎是实际问题?动画是不是开始了?究竟是什么与他们呢?有没有可能发挥作用的周边代码? – dakab
看一个FAQ animate:https://css-tricks.com/transforms-on-svg-elements/ – KingRider