SVGAnimationElement: phương thức beginElement()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

Phương thức beginElement() của SVGAnimationElement tạo một thời điểm bắt đầu cho thời gian hiện tại. Thời điểm mới được thêm vào danh sách thời điểm bắt đầu. Hành vi của phương thức này tương đương với beginElementAt(0).

Cú pháp

js
beginElement()

Tham số

Không có.

Giá trị trả về

Không có.

Ví dụ

Ví dụ này minh họa cách sử dụng beginElement() để bắt đầu một phần tử hoạt hình:

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

Thông số kỹ thuật

Thông số kỹ thuật
SVG Animations Level 2
# __svg__SVGAnimationElement__beginElement

Tương thích trình duyệt