<animateMotion>

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.

Элемент <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>

Контекст использования

КатегорииЭлемент анимации
Разрешённый контентЛюбое количество следующих элементов, в любом порядке:
Элементы описания
<mpath>

Атрибуты

DOM интерфейс

Этот элемент реализует интерфейс SVGAnimateMotionElement.

Спецификации

Specification
SVG Animations Level 2
# AnimateMotionElement

Совместимость с браузерами

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
animateMotion
calcMode
fill
href
keyPoints
origin
path
rotate
systemLanguage

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Смотрите также