While the W3C touch events API is quite flexible in its low-level implementation for dealing with multi-touch interaction, it means that the higher level gestures we use daily in our web apps can take quite a lot of work for developers to implement themselves, even down to the basic ‘tap’ event. Many mobile web frameworks already offer support for such gestures, but if your app does not use or require such a framework, something as simple as a ‘tap’ plugin can become a necessity on nearly every mobile project.
Please see the GitHub repo for setup instructions.
<head> of your HTML document:
Next create a new Tap instance, passing the element you want to use:
You can stop listening for tap events like so:
Please see the GitHub readme for up to date browser support details.