# 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 create with:

const mpath = parentElement.add('mpath')

It's possible create 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 shape

  • returns: {gySVGObject} The original object

const href = pattern.href();

Get the href current value.