【发布时间】:2017-09-19 18:33:40
【问题描述】:
考虑以下 SVG 代码,用于围绕屏幕中心移动一个带有硬编码尺寸的圆圈:
<svg xmlns="http://www.w3.org/2000/svg">
<g>
<ellipse id="circ" style="fill:#000000"
cx="60%" cy="50%"
rx="10" ry="10" />
<!--Assuming window size is 1000x1000-->
<animateTransform attributeName="transform"
type="rotate" dur="10s"
from="0,500,500"
to="360,500,500"
repeatCount="indefinite"/>
</g>
</svg>
如果我尝试以百分比形式提供旋转中心,则动画根本不起作用:
<animateTransform attributeName="transform"
type="rotate" dur="10s"
from="0,50%,50%"
to="360,50%,50%"
repeatCount="indefinite"/>
我该如何解决这个问题?
【问题讨论】:
标签: animation svg units-of-measurement smil