Skip to content

Latest commit

 

History

History
23 lines (21 loc) · 567 Bytes

README.md

File metadata and controls

23 lines (21 loc) · 567 Bytes

swipe-util

Swipe event utility for mobile devices.

Try it out

http://tehvgg.github.io/swipe-util/

How to use it?

Include the script in your head.

<script src="swipe.js"></script>

Instantiate the class.

var el = document.body;
var swipe = new Swipe(el, { doPreventScroll: true });

Apply your event listeners.

el.addEventListener(swipe.up, handleSwipe);
el.addEventListener(swipe.down, handleSwipe);
el.addEventListener(swipe.left, handleSwipe);
el.addEventListener(swipe.right, handleSwipe);