SVGAnimationElement:beginElementAt() 方法

Baseline 已廣泛支援

此特性已相當成熟,可在許多裝置和瀏覽器版本上使用。自 ⁨2020 年 1 月⁩ 起,所有主流瀏覽器均已支援。

SVGAnimationElement 方法 beginElementAt() 會在當前時間加上指定的偏移量來建立一個開始例項時間。新的例項時間會被新增到開始例項時間列表中。

語法

js
beginElementAt(offset)

引數

offset

一個浮點數,表示開始元素的時間相對於當前文件時間的偏移量(以秒為單位)。

返回值

None

示例

此示例演示瞭如何使用 beginElementAt() 在延遲 2 秒後啟動一個動畫元素。

js
const animationElement = document.querySelector("animate");
animationElement.beginElementAt(2);
console.log("Animation will start after a 2-second delay.");

規範

規範
SVG 動畫級別 2
# __svg__SVGAnimationElement__beginElementAt

瀏覽器相容性