非常教程

SVG参考手册

分类 | Elements

animatecolor

弃用

该功能已从Web标准中删除。尽管一些浏览器可能仍然支持,但它正在被丢弃。避免使用它并尽可能更新现有的代码; 请参阅本页面底部的兼容性表格来指导您的决定。请注意,此功能可能随时停止工作。

这个元素在SVG 1.1第二版中已被弃用,并可能在未来的SVG版本中被删除。它不提供使用<animate>元素不可用的功能。所以,作者应该使用<animate>元素来代替。

<animateColor>SVG元素指定随时间变化的色彩变换。

用法上下文

分类

基本形状元素,图形元素,形状元素

允许的内容

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

属性

全局属性

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

具体属性

  • by
  • from
  • to

DOM接口

这个元素实现了SVGAnimateColorElement接口。

SVG

<svg width="120" height="120" xmlns="http://www.w3.org/2000/svg">
  <circle cx="60" cy="60" r="50">
    <animateColor attributeName="fill" attributeType="XML"
        from="black" to="red" dur="6s" repeatCount="indefinite"/>
  </circle>
</svg>

结果

产品规格

Specification

Status

Comment

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

Recommendation

Initial definition

浏览器兼容性

Feature

Chrome

Edge

Firefox (Gecko)

IE

Opera

Safari

Basic support

No support

No support

No support

No support

No support

?

Feature

Android

Firefox Mobile (Gecko)

IE Phone

Opera Mobile

Safari Mobile

Basic support

?

?

?

?

?

SVG

可缩放矢量图形是基于可扩展标记语言(标准通用标记语言的子集),用于描述二维矢量图形的一种图形格式。它由万维网联盟制定,是一个开放标准。