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

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 endElement() của SVGAnimationElement tạo một thời điểm kết thúc 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 kết thúc. Hành vi của phương thức này tương đương với endElementAt(0).

Cú pháp

js
endElement()

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 endElement() để kết thúc một phần tử hoạt hình:

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

Thông số kỹ thuật

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

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