You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zero-dependency, minimal swipe-gesture listener for the web.
@@ -73,7 +74,7 @@ container.addEventListener('swipe', function (e) {
73
74
</script>
74
75
```
75
76
76
-
Swipe-listener is also available from unpkg: [`https://unpkg.com/swipe-listener@1.2.0/dist/swipe-listener.min.js`](https://unpkg.com/swipe-listener@1.2.0/dist/swipe-listener.min.js)
77
+
Swipe-listener is also available from unpkg: [`https://unpkg.com/swipe-listener@1.3.1/dist/swipe-listener.min.js`](https://unpkg.com/swipe-listener@1.3.1/dist/swipe-listener.min.js)
77
78
78
79
## Installing using NPM
79
80
@@ -113,16 +114,16 @@ Data passed to `event.detail`:
113
114
114
115
### Options
115
116
116
-
| Key | Description | Default value |
117
-
| --- | --- | --- |
118
-
|`minHorizontal`| Minimum number of horizontal pixels travelled for the gesture to be considered as a left or right swipe. |`10`|
119
-
|`minVertical`| Minimum number of vertical pixels travelled for the gesture to be considered as a top or bottom swipe. |`10`|
120
-
|`deltaHorizontal`| Maximum difference between the rightmost pixel (right-swipe) or the leftmost pixel (left-swipe) travelled to and the pixel at which the gesture is released. |`3`|
121
-
|`deltaVertical`| Maximum difference between the bottommost pixel (bottom-swipe) or the topmost pixel (top-swipe) travelled to and the pixel at which the gesture is released. |`5`|
122
-
|`preventScroll`| Prevents page scrolling when swiping on the DOM element. Can also be specified as a function with the signature `(event) => boolean`|`false`|
123
-
|`lockAxis`| Enforces only one direction to be true instead of multiple. Selects the direction with the most travel. Is not enforced when the travel is equal. Example: for a top-left swipe, only one of `top` and `left` will be `true` instead of both. |`true`|
124
-
|`touch`| Whether to listen for swipes with touch events |`true`|
125
-
|`mouse`| Whether to listen for swipes with mouse events |`true`|
|`minHorizontal`| Minimum number of horizontal pixels travelled for the gesture to be considered as a left or right swipe. |`10`|
120
+
|`minVertical`| Minimum number of vertical pixels travelled for the gesture to be considered as a top or bottom swipe. |`10`|
121
+
|`deltaHorizontal`| Maximum difference between the rightmost pixel (right-swipe) or the leftmost pixel (left-swipe) travelled to and the pixel at which the gesture is released. |`3`|
122
+
|`deltaVertical`| Maximum difference between the bottommost pixel (bottom-swipe) or the topmost pixel (top-swipe) travelled to and the pixel at which the gesture is released. |`5`|
123
+
|`preventScroll`| Prevents page scrolling when swiping on the DOM element. Can also be specified as a function with the signature `(event) => boolean`|`false`|
124
+
|`lockAxis`| Enforces only one direction to be true instead of multiple. Selects the direction with the most travel. Is not enforced when the travel is equal. Example: for a top-left swipe, only one of `top` and `left` will be `true` instead of both. |`true`|
125
+
|`touch`| Whether to listen for swipes with touch events |`true`|
126
+
|`mouse`| Whether to listen for swipes with mouse events |`true`|
126
127
127
128
### `.off()`
128
129
@@ -143,48 +144,48 @@ Emitted once a swipe is completed.
143
144
144
145
`event.detail` contains
145
146
146
-
| key | type | description |
147
-
| --- | --- | --- |
148
-
|`directions`| Object | Object containing `top`, `left`, `bottom`, `right` keys. The directions in which the swipe is performed are set to `true`. |
149
-
|`x`| Array | Array of two items: the starting x-coordinate and the ending x-coordinate. |
150
-
|`y`| Array | Array of two items: the starting y-coordinate and the ending y-coordinate. |
151
-
|`touch`| Boolean | Whether or not `TouchEvent` was used for this particular event. |
0 commit comments