Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

MoveAnimation

MikhailTymchukDX edited this page Apr 12, 2017 · 2 revisions

MoveAnimation (inherits ParallelAnimation)

The MoveAnimation is used to move the target element. If the relative flag is set to true, then it treats the horizontal and vertical properties as offsets to move the element. If the relative flag is false, then it will treat the horizontal and vertical properties as coordinates on the page where the target element should be moved. It is important to note that the target must be positioned (i.e. absolutely) so that settings its top/left style attributes will change its location.

Client methods

Name Description
constructor(target, duration, fps, horizontal, vertical, relative, unit)
onStart() The onStart method is called just before the animation is played each time.

Client methods

constructor(target, duration, fps, horizontal, vertical, relative, unit)

Params:

  • target

    • Type: Object
    • Description: Length of the animation in seconds. The default is 1.
  • duration

    • Type: Number
    • Description: Length of the animation in seconds. The default is 1.
  • fps

    • Type: Number
    • Description: Number of steps per second. The default is 25.
  • horizontal

    • Type: Number
    • Description: If relative is true, this is the offset to move horizontally. Otherwise this is the x coordinate on the page where the target should be moved.
  • vertical

    • Type: Number
    • Description: if relative is true, this is the offset to move vertically. Otherwise this is the y coordinate on the page where the target should be moved.
  • relative

    • Type: Boolean
    • Description: true if we are moving relative to the current position, false if we are moving absolutely.
  • unit

    • Type: String
    • Description: Unit of the interpolated values. The default value is 'px'.

onStart()

The onStart method is called just before the animation is played each time.

Clone this wiki locally