https://github.com/webdeveric/swipe-dispatcher
Dispatch custom swipe events to DOM nodes.
https://github.com/webdeveric/swipe-dispatcher
events swipe swipe-dispatcher touch
Last synced: 2 months ago
JSON representation
Dispatch custom swipe events to DOM nodes.
- Host: GitHub
- URL: https://github.com/webdeveric/swipe-dispatcher
- Owner: webdeveric
- License: mit
- Created: 2016-04-15T18:52:45.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T17:58:37.000Z (over 2 years ago)
- Last Synced: 2025-02-12T10:56:46.886Z (3 months ago)
- Topics: events, swipe, swipe-dispatcher, touch
- Language: JavaScript
- Size: 252 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Swipe Dispatcher
Dispatch custom `swipe` events to DOM nodes.
## Install
```shell
npm install swipe-dispatcher --save
```## Usage
```js
import SwipeDispatcher from 'swipe-dispatcher';new SwipeDispatcher( { /* options */ } );
```## Options
| Option | Default | Description |
| :----- | :------ | :---------- |
| `root` | `document.documentElement` | Event listeners get attached to this node |
| `maxTime` | `333` | The maximum time a swipe should take |
| `minDistance` | `100` | The minimum move distance |
| `variance` | `100` | The allowed horizontal/vertical variance |
| `preventMove` | `true` | Should `preventDefault` be called on `touchmove` |