Skip to content
forked from benhowdle89/touche

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

License

Notifications You must be signed in to change notification settings

jantimon/touche

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%