【发布时间】:2020-05-23 01:40:39
【问题描述】:
我刚开始玩 SVG 动画。我希望动画尽快开始,但似乎动画仅在页面完全加载后才开始,包括图像。真的吗?有人可以证实吗?反正就在附近?
我创建了一个包含大图像 (1.7MB) 作为示例的小提琴。请检查一下: https://jsfiddle.net/8mu69Lm5/2/
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="300" height="100">
<rect x="150" y="20" width="60" height="60" fill="blue" transform="rotate(91.0292 180 50)">
<animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 180 50" to="360 180 50" dur="4s" repeatCount="indefinite"/>
</rect>
</svg>
<img src="http://images6.alphacoders.com/370/370399.jpg">
更新:清除缓存然后点击运行,因为 jsfiddle 会预加载图像
【问题讨论】:
-
是的!它不会改变任何东西。