<animateTransform>
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ần tử <animateTransform> của SVG hoạt ảnh hóa một thuộc tính biến đổi trên phần tử đích của nó, từ đó cho phép các hoạt ảnh điều khiển dịch chuyển, co giãn, xoay và/hoặc nghiêng.
Ngữ cảnh sử dụng
| Categories | Animation element |
|---|---|
| Permitted content | Any number of the following elements, in any order: Descriptive elements |
Ví dụ
html
<svg
width="120"
height="120"
viewBox="0 0 120 120"
xmlns="http://www.w3.org/2000/svg">
<polygon points="60,30 90,90 30,90">
<animateTransform
attributeName="transform"
attributeType="XML"
type="rotate"
from="0 60 70"
to="360 60 70"
dur="10s"
repeatCount="indefinite" />
</polygon>
</svg>
Thuộc tính
Giao diện DOM
Phần tử này triển khai giao diện SVGAnimateTransformElement.
Đặc tả
| Specification |
|---|
| SVG Animations Level 2> # AnimateTransformElement> |