Effortlessly re-map click events to touch events on touchscreen UIs
JavaScript
Switch branches/tags
Nothing to show
Latest commit 13f27db Jan 24, 2017 @benhowdle89 committed on GitHub Merge pull request #24 from alexdresko/update-jquery-dependency
Support jQuery 1.10.0 or higher
Permalink
Failed to load latest commit information.
dist fixes #10 Nov 11, 2013
src Event name is not always provided which may cause errors, fixes #13 Jan 13, 2015
.gitignore Add grunt and jshint Oct 27, 2013
.jshintrc Add grunt and jshint Oct 27, 2013
Gruntfile.js Add grunt and jshint Oct 27, 2013
LICENSE Initial commit Oct 9, 2013
README.md Update README.md Oct 15, 2013
bower.json Support jQuery 1.10.0 or higher Jan 24, 2017
package.json

README.md

Touche.js

Effortlessly re-map click events to touch events on touchscreen UIs

Full docs →

  • 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

<!-- somewhere before the rest of your JavaScript code -->
<script type="text/javascript" src="/path/to/touche.js"></script>

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);