Small JS plugin to handle swipe gestures.
$ yarn add swipelistener-js
import Swipe from 'swipelistener-js/src/main'
const swipe = new Swipe(el, options)
swipe.init()
function up() {
printText('Swipe up')
}
swipe
.on('swipeup', up)
.on('swipedown', () => {
printText('Swipe down')
})
swipe.off('swipeup', up)
Standart options
{
moveCallbacks: false,
resistance: 0,
}
swipe.on(eventName, callback)
swipe.off(eventName, callback)
swipe.destroy()
- swipeup
- swipedown
- swipeleft
- swiperight
- moveup
- movedown
- moveleft
- moveright