touchtap-event

2.0.2 • Public • Published

touchtap-event

Build Status

A lightweight JavaScript library that adds a touchtap custom event to the document which can be listened to on any element. This will only emit an event on touch enabled devices or those emulating touch devices.

It works by listening to various touch events to dispatch the event if the touchstart and touchend events were in approximately the same position and took <= 200ms.

Installing

# via bower 
bower install --save touchtap-event
 
# via NPM 
npm install --save touchtap-event

Including

<!-- Bower -->
<script src="bower_components/touchtap-event/touchtap-event.js"></script>
 
<!-- NPM -->
<script src="node_modules/touchtap-event/touchtap-event.js"></script>

Usage

var elem = document.querySelector('#some-element');
elem.addEventListener('touchtap', function (e) {
  console.log(e);
});

See also

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.2
    286
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.2
    286
  • 2.0.1
    0
  • 2.0.0
    0

Package Sidebar

Install

npm i touchtap-event

Weekly Downloads

286

Version

2.0.2

License

MIT

Last publish

Collaborators

  • tyriar