Giter Site home page Giter Site logo

juzai123 / touche Goto Github PK

View Code? Open in Web Editor NEW

This project forked from benhowdle89/touche

0.0 2.0 0.0 30 KB

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

Home Page: http://benhowdle.im/touche

License: MIT License

JavaScript 100.00%

touche's Introduction

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

touche's People

Contributors

benhowdle89 avatar jantimon avatar alexdresko avatar andekande avatar pvorb avatar ramana-chavakula avatar wmadden avatar silverkorn avatar

Watchers

James Cloos avatar 吴志杰 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.