AxesController
A controller that handles the @egjs/axes events
#
Properties#
axesAn Axes instance
Type: Axes
See:
#
stateA activated State that shows the current status of the user input or the animation
Type: State
#
animatingContextA context of the current animation playing
Type: object
PROPERTY | TYPE | DESCRIPTION |
---|---|---|
start | number | A start position of the animation |
end | number | A end position of the animation |
offset | number | camera offset |
#
enabledA Boolean indicating whether the user input is enabled
Type: boolean
#
positionCurrent position value in Axes instance
Type: number
#
bounceActual bounce size(px)
Type: Array<number>
#
Methods#
initInitialize AxesController
Returns: this
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
flicking | Flicking | no | An instance of Flicking |
#
destroyDestroy AxesController and return to initial state
Returns: void
#
enableEnable input from the user (mouse/touch)
Returns: this
#
disableDisable input from the user (mouse/touch)
Returns: this
#
updateUpdate @egjs/axes's state
Returns: this
Throws: FlickingError
NOT_ATTACHED_TO_FLICKING When init is not called before
#
animateToRun Axes's setTo using the given position
Returns: Promise<void>
- A Promise which will be resolved after reaching the target position
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
position | number | no | A position to move | |
duration | number | no | Duration of the animation (unit: ms) | |
axesEvent | number | yes | If provided, it'll use its setTo method instead |
Throws: FlickingError
code | condition |
---|---|
NOT_ATTACHED_TO_FLICKING | When init is not called before |
ANIMATION_INTERRUPTED | When the animation is interrupted by user input |