Skip to main content

ElementSwipe

A namespace for adding touch-based swiping behavior to elements

Index

Interfaces

Interfaces

Options

Options:

optionalanimation

animation?: Animation

A custom animation to play after succesfully executing a swipe

Defaults to a translation + fade-out in the Options.direction direction.

optionaldirection

direction?: left | right | up | down

The direction one should swipe in.

Defaults to right.

optionalminSwipeDistance

minSwipeDistance?: number

The minimum distance one should swipe in pixels.

Defaults to 2.5% of the browser window's width.

optionalonClose

onClose?: (elem: HTMLElement, ev: TouchEvent) => any

A callback to-be executed after succesfully swiping.

Default to dispatching a click event.


Type declaration

    • (elem: HTMLElement, ev: TouchEvent): any
    • Parameters

      • elem: HTMLElement
      • ev: TouchEvent

      Returns any

Page Options