Move
Overview
The Move component moves the carousel by applying styles to the list element.
Methods
move()
move( dest: number, index: number, prev: number ): voidMoves the carousel to the dest index with the Transition component.
This method does not update the current index. Use Controller#go instead.
Params
dest | A destination index to go to, including clones'. |
|---|---|
index | A slide index. |
prev | A previous index. |
jump()
jump( index: number ): voidJumps to the slide at the specified index.
Params
index | An index to jump to. |
|---|
translate()
translate( position: number ): voidMoves the carousel to the provided position.
Params
position | The position to move to. |
|---|
cancel()
cancel(): voidCancels transition.
toIndex()
toIndex( position: number ): numberConverts the provided position to the closest slide index.
Params
position | A position to convert. |
|---|
Return
The closest index to the position.
toPosition()
toPosition( index: number, trimming?: boolean ): numberConverts the provided index to the position in pixel.
Params
index | An index to convert. |
|---|---|
trimming | Optional. Whether to trim edge spaces or not. |
Return
The position corresponding with the index.
getPosition()
getPosition(): numberReturns the current position.
Return
The position of the list element.
getLimit()
getLimit( max: boolean ): numberReturns the limit position that the carousel can move to.
Params
max | Determines whether to return the maximum or minimum limit. |
|---|
Return
The border position.
exceededLimit()
exceededLimit( max?: boolean | undefined, position?: number ): booleanChecks if the provided position exceeds the minimum or maximum limit or not.
Params
max | Optional. |
|---|---|
position | Optional. A position to test. If omitted, tests the current position. |
Return
true if the position exceeds the limit, or otherwise false.