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

瀏覽器相容性