files/en-us/web/svg/reference/element/animatemotion/index.md
The <animateMotion> SVG element provides a way to define how an element moves along a motion path.
[!NOTE] To reuse an existing path, it will be necessary to use an {{SVGElement("mpath")}} element inside the
<animateMotion>element instead of the {{SVGAttr("path")}} attribute.
{{svginfo}}
auto | auto-reverse; Default value: 0; Animatable: no[!NOTE] For
<animateMotion>, the default value for the {{SVGAttr("calcMode")}} attribute ispaced.
onbegin, onend, onrepeatThis element implements the {{domxref("SVGAnimateMotionElement")}} interface.
html,
body,
svg {
height: 100%;
margin: 0;
padding: 0;
display: block;
}
<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>
{{EmbedLiveSample('Example', 150, '100%')}}
{{Specifications}}
{{Compat}}