npm install node-touch
Extra touch events and hover behaviour for touch devices.
In order to use the features, you have to call the module once in the beginning and create the dom elements with the
On touch devices, the hover behaviour is quite crappy. With this module, if you use the
.hover class instead of the
:hover pseudoclass, on a touch device the class will be applied when the element is touched on the screen, and on a non-touch device it will act as
var button = documentbuttonclassList;documentbody;button;
You can use the
tap event just as a normal event. It is sort of the touch equivalent of
var div = document;div;
The event fires when the finger left the element.
You can add listeners to swipe events. There are three type of swipe events.
event object's important properties are:
This module sets a global Boolean that just tells you whether the user is on a touch device. It can be useful!