Classdesc

Plugin that enables mouse/pointer drag. Note, that touch interaction is enabled natively in all browsers.

Hierarchy (view full)

Constructors

Properties

quickSwipeDistance: number

If this is null: The next/previous slide will not be reached unless you drag for more than half the slider's width.

If this is a number: Dragging any slide for more than this distance in pixels will slide to the next slide in the desired direction.

lastX: number

Last drag event position

startX: number

Where the dragging started

Reference to the slider this plugin is attached to.

Accessors

  • get id(): string
  • Unique Plugin ID, used as index in ScrollSnapSlider::plugins.

    Returns string

    See

Methods

  • Scroll the slider the appropriate amount of pixels and update the last event position

    Parameters

    • event: MouseEvent

    Returns void

  • Clear disable timeout, set up variables and styles and attach the listener.

    Parameters

    • event: MouseEvent

    Returns void

  • Remove listener and clean up the styles. Note: We first restore the smooth behaviour, then manually snap to the current slide. Using a timeout, we then restore the rest of the snap behaviour.

    Parameters

    • event: MouseEvent

    Returns void

Generated using TypeDoc