Tap listener
Listens to taps
On mobile devices, the click
event is triggered after a delay. Tap Listener listens for native touch and pointer events to trigger a callback immediately.
Used in Flickity.
var tapper = element ;tapper;
Use TapListener
to extend a class.
{//...}// inherit Tap ListenerWidgetprototype = ;// or_;var widgy = element ;widgy;
Install
Bower: bower install tap-listener --save
npm: npm install tap-listener
RequireJS
;
Browserify
var TapListener = ;var tapper = element ;
API
var tapper = element// element {Element} - binds tap events to elementtapper// element {Element} - binds tap events to elementtapper// unbinds tap eventstapper// eventName {String} - tap, pointerDown, pointerMove, pointerUp, pointerCancel// callback {Function}{...}// event {Event} - the original mouseup, touchend, or pointerup event// pointer {Event} or {Touch} - event object with pageX and pageYtapper// unbinds tap events
MIT license
By Metafizzy