Skip to content

textmode.js / Textmodifier / swipe

Method: swipe() ​

ts
swipe(callback): void;

Register a callback for swipe gestures.

Swipes provide a normalised direction vector, travelled distance, and velocity in CSS pixels per millisecond. Useful for panning, flicks, or quick shortcuts.

Parameters ​

ParameterTypeDescription
callbackTouchSwipeHandlerHandler to run when a swipe gesture is detected.

Returns ​

void

Example ​