首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

animate

animate元素放在一个形状元素中,并定义元素的属性如何改变动画。该属性将在指定的时间内从初始值变为结束值。

用法上下文

分类

动画元素

允许的内容

任意数量的以下元素,以任何顺序:描述性元素

属性

全局属性

  • Conditional processing attributes »
  • Core attributes »
  • Animation event attributes »
  • Xlink attributes »
  • Animation attribute target attributes »
  • Animation timing attributes »
  • Animation value attributes »
  • Animation addition attributes »
  • externalResourcesRequired

具体属性

  • attributeName
  • attributeType
  • from
  • to
  • dur
  • repeatCount

DOM接口

这个元素实现了SVGAnimateElement接口。

SVG

代码语言:javascript
复制
<?xml version="1.0"?>
<svg width="120" height="120" viewPort="0 0 120 120" version="1.1"
     xmlns="http://www.w3.org/2000/svg">
  
  <rect x="10" y="10" width="100" height="100">
    <animate attributeType="XML" attributeName="x" from="-100" to="120"
        dur="10s" repeatCount="indefinite"/>
  </rect>
</svg>

结果

产品规格

Specification

Status

Comment

SVG Animations Level 2The definition of '<animate>' in that specification.

Editor's Draft

No change

Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of '<animate>' in that specification.

Recommendation

Initial definition

浏览器兼容性

Feature

Chrome

Firefox (Gecko)

Internet Explorer

Opera

Safari (WebKit)

Basic support

2.0

4.0 (2.0)

No support

9.0

4.0

Feature

Android

Firefox Mobile (Gecko)

IE Phone

Opera Mobile

Safari Mobile

Basic support

?

4.0 (2.0)

No support

9.5

4.0

扫码关注腾讯云开发者

领取腾讯云代金券