<animate>
元素用于实现动画效果(动画截图比较麻烦,本文中的例子最好直接写demo看效果)
基本动画
将1
2
3
4
5
6
7
8<rect x="10" y="10" width="200" height="20" stroke="black" fill="none">
<animate
attributeName="width"
attributeType="XML"
from="200" to="20"
begin="0s" dur="5s"
fill="freeze" />
</rect>
以上代码会一个20020的长方形,在5秒内渐变成一个2020的正方形,并且在动画结束时停留在正方形的状态。