Capítulo 280 de 411

Chapter 280: MotionPathPlugin.getRelativePosition()

Core Idea

Returns the x/y gap between two elements' chosen reference points, correctly accounting for any nested transforms on either — result is expressed in the fromElement's parent's coordinate system.

Reference Tables

ParameterTypeDescription
fromElementElement | windowelement the distance is measured from
toElementElement | windowdestination element (must be a real reference)
fromOrigin, toOriginArray | Object | Stringreference points on each element

Returns: {x, y}.

Connects To

  • MotionPathPlugin.convertCoordinates(), getAlignMatrix(): related coordinate-space utilities.