Scroll
Scroll
Overview
The Scroll component scrolls the carousel to the arbitrary position without the Transition component. This component moves the carousel by requestAnimationFrame
. The Drag component uses this in the drag free mode.
Methods
scroll()
scroll( position: number, duration?: number, snap?: boolean, callback?: AnyFunction ): void
Scrolls the carousel to the specified destination.
Unlike Controller#scroll()
, this method does not update active and previous indices.
Params
destination | A position or an index to scroll to. The |
---|---|
duration | Optional. Specifies the scroll duration. If omitted, it is computed by distance. |
snap | Optional. Whether to snap the closest slide or not. |
callback | Optional. A callback function invoked after scroll ends. |
cancel()
cancel(): void
Cancels scrolling and emits the scrolled
event.