Swipe
Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
Constructor
import {EventManager, InputDirection, Swipe} from 'mjolnir.js';
const eventManager = new EventManager({
// ...
recognizers: [new Swipe({direction: InputDirection.Horizontal})]
});
options(object, optional) - Optionsevent(string) - Name of the event. Default'swipe'.pointers(number) - Required pointers. Default1.threshold(number) - Minimal distance required before recognizing. Default10.direction(InputDirection) - Direction of the panning. DefaultInputDirection.All.velocity(number) - Minimal velocity required before recognizing, unit is in px per ms. Default0.3.
Events
- swipe, together with all of below
- swipeleft
- swiperight
- swipeup
- swipedown
Source
https://github.com/visgl/mjolnir.js/blob/master/src/hammerjs/recognizers/swipe.ts