# mpath
The mpath
sub-element for the animateMotion
element provides the ability to reference an external path
element as the definition of a motion path.
This element implements the SVGMPathElement interface.
Usually, this element is created with:
const mpath = parentElement.add('mpath')
It's possible to create it as a disconnected element with gySVG('mpath')
and attach it to the SVG document with .attachTo()
.
More info: mdn (opens new window) | w3c (opens new window)
# .href()
pattern.href( URLPath )
Set the href
attribute. It defines a URL referring to the path
element or basic shape which defines the motion path.
argument:
{string} URLPath
URL to a path or other basic shapereturns:
{gySVGObject}
The original object
const href = pattern.href();
Get the href
current value.