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:
js
const mpath = parentElement.add('mpath')
It's possible to create it as a disconnected element with gSVG('mpath')
and attach it to the SVG document with .attachTo()
.
.href()
js
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:
{gSVGObject}
The original object
js
const href = pattern.href();
Get the href
current value.