SVGAnimationElement: phương thức beginElementAt()
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 beginElementAt() của SVGAnimationElement tạo một thời điểm bắt đầu cho thời gian hiện tại cộng với độ lệch đã chỉ định. Thời điểm mới được thêm vào danh sách thời điểm bắt đầu.
Cú pháp
js
beginElementAt(offset)
Tham số
offset-
Một số thực biểu thị độ lệch từ thời gian tài liệu hiện tại, tính bằng giây, tại đó phần tử sẽ bắt đầu.
Giá trị trả về
Không có.
Ví dụ
Ví dụ này minh họa cách sử dụng beginElementAt() để bắt đầu một phần tử hoạt hình sau khi trì hoãn 2 giây:
js
const animationElement = document.querySelector("animate");
animationElement.beginElementAt(2);
console.log("Animation will start after a 2-second delay.");
Thông số kỹ thuật
| Thông số kỹ thuật |
|---|
| SVG Animations Level 2> # __svg__SVGAnimationElement__beginElementAt> |