SVGAnimationElement: beginElement() 方法

Baseline 已广泛支持

此特性已相当成熟,可在许多设备和浏览器版本上使用。自 ⁨2020 年 1 月⁩ 起,所有主流浏览器均已支持。

SVGAnimationElement 方法 beginElement() 为当前时间创建一个开始实例时间。新的实例时间会被添加到开始实例时间的列表中。此方法的行为等同于 beginElementAt(0)

语法

js
beginElement()

参数

无。

返回值

None

示例

本示例演示了如何使用 beginElement() 来启动一个动画元素。

js
const animationElement = document.querySelector("animate");
animationElement.beginElement();
console.log("Animation has started.");

规范

规范
SVG 动画级别 2
# __svg__SVGAnimationElement__beginElement

浏览器兼容性