FreeControl
A Control that can be scrolled freely without alignment
#
ConstructorPARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
Partial<FreeControlOptions> | yes | {} |
#
Properties#
stopAtEdgeMake scroll animation to stop at the start/end of the scroll area, not going out the bounce area
Type: boolean
Default: true
#
controllerA controller that handles the @egjs/axes events
Type: AxesController
#
activeIndexIndex number of the currentPanel
Type: number
Default: 0
#
activePanelAn active panel
Type: Panel | null
#
animatingWhether Flicking's animating
Type: boolean
#
holdingWhether user is clicking or touching
Type: boolean
#
Methods#
updatePositionUpdate position after resizing
Returns: Promise<void>
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
progressInPanel | number | no | Previous camera's progress in active panel before resize |
Throws: FlickingError
NOT_ATTACHED_TO_FLICKING When init is not called before
#
moveToPositionMove Camera to the given position
Returns: Promise<void>
- A Promise which will be resolved after reaching the target position
Emits: Flicking#event:moveStart, Flicking#event:move, Flicking#event:moveEnd, Flicking#event:willChange, Flicking#event:changed, Flicking#event:willRestore, Flicking#event:restored, Flicking#event:needPanel, Flicking#event:visibleChange, Flicking#event:reachEdge
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
position | number | no | The target position to move | |
duration | number | no | Duration of the panel movement animation (unit: ms). | |
axesEvent | object | yes | release event of Axes |
Throws: FlickingError
code | condition |
---|---|
POSITION_NOT_REACHABLE | When the given panel is already removed or not in the Camera's range |
NOT_ATTACHED_TO_FLICKING | When init is not called before |
ANIMATION_INTERRUPTED | When the animation is interrupted by user input |
STOP_CALLED_BY_USER | When the animation is interrupted by user input |
#
initInitialize Control
Returns: this
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
flicking | Flicking | no | An instance of Flicking |
#
destroyDestroy Control 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
#
updateInputUpdate controller's state
Returns: this
#
resetActiveReset activePanel and activeAnchor to null
Returns: this
#
moveToPanelMove Camera to the given panel
Returns: Promise<void>
- A Promise which will be resolved after reaching the target panel
Emits: Flicking#event:moveStart, Flicking#event:move, Flicking#event:moveEnd, Flicking#event:willChange, Flicking#event:changed, Flicking#event:willRestore, Flicking#event:restored, Flicking#event:needPanel, Flicking#event:visibleChange, Flicking#event:reachEdge
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
panel | Panel | no | The target panel to move | |
options | object | no | An options object | |
duration | number | no | Duration of the animation (unit: ms) | |
axesEvent | object | yes | release event of Axes | |
direction | DIRECTION | yes | DIRECTION.NONE | Direction to move, only available in the circular mode |
Throws: FlickingError
code | condition |
---|---|
POSITION_NOT_REACHABLE | When the given panel is already removed or not in the Camera's range |
NOT_ATTACHED_TO_FLICKING | When init is not called before |
ANIMATION_INTERRUPTED | When the animation is interrupted by user input |
STOP_CALLED_BY_USER | When the animation is interrupted by user input |