SnapTransition
SnapTransition is a method of transitioning between two values (numbers, or arrays of numbers). It is similar to SpringTransition except the transition can be much faster and always has a damping effect.
SnapTransition(state)
Constructor Parameters
state
Number|Array
Initial state
Methods
Show Private Methods
SnapTransition.DEFAULT_OPTIONS()Protected Static
period()
The amount of time in milliseconds taken for one complete oscillation when there is no damping Range : [0, Infinity]
dampingRatio()
The damping of the snap. Range : [0, 1]
velocity()
The initial velocity of the transition.
reset(state, velocity)
Resets the state and velocity
Parameters
velocity
Number|Array
Velocity
getVelocity()
Getter for velocity
Returns
Number|Array
velocity
setVelocity()
Setter for velocity
Returns
Number|Array
velocity
isActive()
Detects whether a transition is in progress
Returns
Boolean
halt()
Halt the transition
get()
Get the current position of the transition s *
Returns
Number|Array
state
set(state, definition, callback)
Set the end position and transition, with optional callback on completion.
Parameters
state
Number|Array
Final state
definition
Object
Transition definition
callback
Function
Callback