Wheel-indicator
Generates event when user makes new movement (like a swipe on a touchscreen).
Connection
<script src="wheel-indicator.js"></script>
or if you use build system:
var WheelIndicator = require('wheel-indicator');
Usage
var indicator = new WheelIndicator({
elem: document.querySelector('.element'),
callback: function(e){
console.log(e.direction) // "up" or "down"
}
});
//The method call
indicator.getOption('preventMouse'); // true
Examples
Listener on the block
var indicator = new WheelIndicator({
elem: document.querySelector('.customZone'),
callback: function(e){
document.querySelector('.customZone').innerHTML = document.querySelector('.customZone').innerHTML + e.direction + '<br />';
}
});
Also you can set `document` as first argument;