attributeName 属性表示动画期间将要更改的目标元素的 CSS 属性或属性的名称。
你可以将此属性与以下 SVG 元素一起使用:
- animate
- animateTransform
- set
示例
html,
body,
svg {
height: 100%;
}
<svg viewBox="0 0 250 250" xmlns="http://www.w3.org/2000/svg">
<rect x="50" y="50" width="100" height="100">
<animate
attributeType="XML"
attributeName="y"
from="0"
to="50"
dur="5s"
repeatCount="indefinite" />
</rect>
</svg>
示例
使用说明
<table class="properties"> <tbody> <tr> <th scope="row">值</th> <td><code><name></code></td> </tr> <tr> <th scope="row">默认值</th> <td><em>None</em></td> </tr> <tr> <th scope="row">动画性</th> <td>无</td> </tr> </tbody> </table>
<name>- :此值表示要动画化的目标元素的 CSS 属性或属性的名称。
规范
参见
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
