WheelSwipe
Trigger swipe-like events with mousewheel and trackpad. View the a demo here: https://andyinabox.github.io/wheel-swipe/
var WheelSwipe = ; var ws = ; window; window;
Usage
WheelSwipe([el], [opts])
Construct a new instance.
el
is the element to listen to. Optional, defaults towindow
object.opts
is also optional, contains the following settings:deltaThreshold
- threshold for scroll delta, can be used to only trigger when the scroll delta is a high number. Defaults to1
debounceThreshold
- threshold for scrolling debounce. Defaults to50
.cancelScroll
- Boolean, whether or not to cancel default scrolling behavior. Defaults totrue
.reverseDelay
- This sets a delay to avoid accidental reversals of swipe (can happen on some devices, namely the Apple Magic Mouse). Defaults to0
(disabled).
Demo
To run the demo using budo:
npm installnpm start
Dependencies
License
MIT, see LICENSE.md for details.