vanilla-touchwipe
v1.0.0
Published
Tiny <100LOC library to detect touch swipe gestures
Downloads
226
Readme
vanilla-touchwipe
This is a vanilla js port of the touchwipe jQuery plgin, (originally written by Andreas Waltl), which is used to detect touch swipe gestures.
Features
- Tiny footprint: < 100 LOC
- Easy to use
Usage
var domNode = document.getElementById('container');
var touch = touchwipe(domNode, {
wipeLeft: function() { alert('left'); },
wipeRight: function() { alert('right'); },
wipeUp: function() { alert('up'); },
wipeDown: function() { alert('down'); },
min_move_x: 20,
min_move_y: 20,
preventDefaultEvents: true
});
touch.unbind();