<animateMotion>
SVG 的 **<animateMotion>** 元素提供了一種定義元素沿著運動路徑移動方式的方法。
示例
html
<svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg">
<path
fill="none"
stroke="lightgrey"
d="M20,50 C20,-50 180,150 180,50 C180-50 20,150 20,50 z" />
<circle r="5" fill="red">
<animateMotion
dur="10s"
repeatCount="indefinite"
path="M20,50 C20,-50 180,150 180,50 C180-50 20,150 20,50 z" />
</circle>
</svg>
使用上下文
屬性
動畫屬性
使用說明
此元素實現了 SVGAnimateMotionElement 介面。
規範
| 規範 |
|---|
| SVG 動畫級別 2 # AnimateMotionElement |
瀏覽器相容性
BCD 表格僅在啟用 JavaScript 的瀏覽器中載入。