A JavaScript library to prevent the 300ms click delay on touch devices.
$ npm install clicktap
$ bower install clicktap
$ component install pazguille/clicktap
<button id="btn">Click me</button>
function litenerFunction() {
// Some code here!
}
var btn = document.getElementById('btn');
clicktap(btn, litenerFunction);
Adds a listener
to a given HTMLElement
on click/tap event.
el
{HTMLElement} - A givenHTMLElement
.listener
{Function} - A givenlistener
to execute on click/tap.capture
{Boolean} - Indicate if use capture path.
clicktap(document, litenerFunction, true);
// or
clicktap.on(document, litenerFunction);
Removes a listener
from a given HTMLElement
.
el
{HTMLElement} - A givenHTMLElement
.listener
{Function} - A givenlistener
to execute on click/tap.
clicktap.off(document, litenerFunction);
MIT license. Copyright © 2014.