# tap.js **Repository Path**: mirrors_davidtheclark/tap.js ## Basic Information - **Project Name**: tap.js - **Description**: A custom 'tap' event JavaScript plugin for touch devices - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-03-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README tap.js ======================================= A custom 'tap' event JavaScript plugin for mobile and tablet web browsers, which eliminates the 300ms delay between a physical 'tap' and the firing of a 'click' event. Uses mouse events as a fallback for browsers that don't support touch. Installation --------------------------------------- * Download: [zip](https://github.com/alexgibson/tap.js/zipball/master) * [NPM](https://www.npmjs.org/): `npm install tap.js` * [Bower](https://github.com/twitter/bower/): `bower install tap.js` * Git: `git clone https://github.com/alexgibson/tap.js` Setup --------- This component can be used as an AMD module, CommonJS module, or a global. ### for AMD module: ``` define(['./tap'], function(Tap) { // ... }); ``` ### for CommonJS: ``` var Tap = require('tap.js'); ``` ### for global in the browser ``` ``` Next create a new Tap instance, passing the element you want to use: ``` var el = document.getElementById('my-id'), myTap = new Tap(el); ``` You can then start listening for 'tap' events using the regular JavaScript event listener syntax: ``` el.addEventListener('tap', onTap, false); function onTap (e) { //your code } ``` You can stop listening for tap events like so: ``` el.removeEventListener('tap', onTap, false); ``` Supported web browsers --------------------------------------- - iOS (Safari, Chrome) - Android (Browser, Chrome) - Firefox OS, Firefox for Android - Opera Mobile (Android) - BlackBerry Playbook - All modern desktop browsers (mouse fallback) jQuery Support --------------------------------------- Should you wish to use tap.js with jQuery, there is an optional [jQuery wrapper](https://github.com/alexgibson/tap.js/blob/master/jquery.tap.js) that you can include in your project.