vanilla-touchwipe

1.0.0 • Public • Published

vanilla-touchwipe Build Status NPM version

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();

License

MIT

Package Sidebar

Install

npm i vanilla-touchwipe

Weekly Downloads

25

Version

1.0.0

License

MIT

Last publish

Collaborators

  • nemtsov