https://github.com/benhowdle89/touche
Effortlessly re-map click events to touch events on touchscreen UIs
https://github.com/benhowdle89/touche
Last synced: about 1 year ago
JSON representation
Effortlessly re-map click events to touch events on touchscreen UIs
- Host: GitHub
- URL: https://github.com/benhowdle89/touche
- Owner: benhowdle89
- License: mit
- Created: 2013-10-09T21:21:23.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-01-24T22:57:43.000Z (over 9 years ago)
- Last Synced: 2024-05-22T21:32:13.095Z (about 2 years ago)
- Language: JavaScript
- Homepage: http://benhowdle.im/touche
- Size: 29.3 KB
- Stars: 605
- Watchers: 23
- Forks: 54
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-projects - touche - Effortlessly re-map click events to touch events on touchscreen UIs ⭐602 `JavaScript` (📦 Legacy & Inactive Projects)
README
Touche.js
======
## Effortlessly re-map click events to touch events on touchscreen UIs
[Full docs →](http://benhowdle.im/touche)
- Removes the 300ms delay (after the user lifts their finger), applied by all touchscreens devices and immediately invokes your click handlers.
- Takes your click events applied with jQuery and silently re-maps them to the "touchend" event for devices that support touch.
- If you're not using jQuery, then Touche exposes a method "on" for your use like so:
Touche(NodeList/Node).on('click', function(){ // handler })
### Usage
### Examples
// applying a click event to one element
Touche(document.querySelector('#myButton')).on('click', handleClick);
// or to multiple at once
Touche(document.querySelectorAll('.myButtons')).on('click', handleClicks);
// or with jQuery
$('.myButtons').on('click', handleClicks);