• Stars
    star
    3,509
  • Rank 12,675 (Top 0.3 %)
  • Language
  • Created about 14 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A duck punch for adding touch events to jQuery UI

jQuery UI Touch Punch

Touch Event Support for jQuery UI

jQuery UI Touch Punch is a small hack that enables the use of touch events on sites using the jQuery UI user interface library.

Visit the official Touch Punch website.

Currently, jQuery UI user interface library does not support the use of touch events in their widgets and interactions. This means that the slick UI you designed and tested in your desktop browser will fail on most, if not all, touch-enabled mobile devices, because jQuery UI listens to mouse events—mouseover, mousemove and mouseout—not touch events—touchstart, touchmove and touchend.

That's where jQuery UI Touch Punch comes in. Touch Punch works by using simulated events to map touch events to their mouse event analogs. Simply include the script on your page and your touch events will be turned into their corresponding mouse events to which jQuery UI will respond as expected.

As I said, Touch Punch is a hack. It duck punches some of jQuery UI's core functionality to handle the mapping of touch events. Touch Punch works with all basic implementations of jQuery UI's interactions and widgets. However, you may find more complex cases where Touch Punch fails. If so, scroll down to learn how you can file and/or fix issues.

This code is dual licensed under the MIT or GPL Version 2 licenses and is therefore free to use, modify and/or distribute, but if you include Touch Punch in other software packages or plugins, please include an attribution to the original software and a link to this Touch Punch website.

Using Touch Punch is as easy as 1, 2…

Just follow these simple steps to enable touch events in your jQuery UI app:

  1. Include jQuery and jQuery UI on your page.

    <script src="http://code.jquery.com/jquery.min.js"></script>
    <script src="http://code.jquery.com/ui/1.8.17/jquery-ui.min.js"></script>
  2. Include Touch Punch after jQuery UI and before its first use.

    Please note that if you are using jQuery UI's components, Touch Punch must be included after jquery.ui.mouse.js, as Touch Punch modifies its behavior.

    <script src="jquery.ui.touch-punch.min.js"></script>
  3. There is no 3. Just use jQuery UI as expected and watch it work at the touch of a finger.

    <script>$('#widget').draggable();</script>

Tested on iPad, iPhone, Android and other touch-enabled mobile devices.

More Repositories

1

Sexy

A Sexy Sequential Ajax (Sajax) Javascript Library for jQuery
JavaScript
90
star
2

vineapple

A simple Vine API client for Node.js
JavaScript
23
star
3

jquery-template

A micro-templating plugin for jQuery (adapted from an original work by John Resig)
JavaScript
23
star
4

jquery-textselection

A library of jQuery plugins for selecting, inserting, and replacing text within form elements
JavaScript
22
star
5

jquery-onavailable

Adds the onAvailable and onContentReady methods to jQuery (via YUI)
HTML
18
star
6

catbot

Remote controlled cat laser built with Arduino, Johnny-Five, Node.js and jQuery at JSConf 2013 NodeBots. Demo: http://www.youtube.com/watch?v=hIW53s4Y2gc
JavaScript
16
star
7

close-enough

"Close Enough" ~ Using JavaScript to Emulate the Abstract Expressionist Masterworks of Chuck Close
JavaScript
15
star
8

jquery-enable

A library of event-based behaviors for augmenting objects with jQuery functionality
JavaScript
13
star
9

jquery-getCSS

Dynamic CSS loading plugin for jQuery
JavaScript
12
star
10

jquery-future

A time machine plugin for jQuery
JavaScript
11
star
11

dollar-q

A JavaScript meta-language for querying large arrays of objects
JavaScript
7
star
12

now-serverless-mysql

Guide for deploying a Serverless MySQL application with Now
JavaScript
5
star
13

jquery-etc

My new kitchen sink for jQuery-related (or not) code.
JavaScript
4
star
14

react-desktop

A boilerplate for building desktop apps with React and nw.js.
JavaScript
4
star
15

jquery-region

jQuery plugin for region and viewport detection (predecessor to IntelligentElements... coming soon!)
JavaScript
3
star
16

jquery-available

A jQuery plugin for detecting DOM element readiness before DOM ready
JavaScript
3
star
17

jquery-route

A hashchange router
3
star
18

is

JavaScript type-checking library
JavaScript
2
star
19

node-microtemplate

A Node.js JavaScript template server using a modified version of John Resig's micro-templating engine
JavaScript
2
star
20

chuckwood

How much wood could a woodchuck chuck…
TypeScript
2
star
21

transmogrifier

Utility for JS object transformations
JavaScript
2
star
22

jquery-dict

Simple translation dictionary plugin for jQuery
JavaScript
2
star
23

jquery-monthselector

A jQuery plugin which creates a simple form for selecting a date by month and year.
JavaScript
2
star
24

jquery-furf

An assortment of JavaScript utilities I've written for jQuery
JavaScript
2
star
25

jquery-update

A jQuery plugin which creates an update event for form elements to provide a (somewhat) normalized change event behavior across element types. It uses polling to detect "change" events in focused text inputs/textareas, before their blur event.
JavaScript
2
star
26

template

A lean and extensible JavaScript template engine.
JavaScript
1
star
27

garp

A static site processor, like Harp.js, but with Gulp.
JavaScript
1
star
28

css-your-wardrobe

Using CSS to define my closet full of plaid.
JavaScript
1
star
29

jquery-many

A "many" event plugin for jQuery which wraps multiple "one" events and fires upon completion of all and each.
JavaScript
1
star
30

harp-boilerplate

A boilerplate for Harp.js projects.
CSS
1
star
31

node-say-something-stupid

The Node.js chat room that talks.
JavaScript
1
star
32

jquery-styleEval

jQuery plugin for dynamically evaluating CSS stylesheets
JavaScript
1
star
33

furf.github.com

A github for furf!
1
star
34

http-server-pkg

A utility for creating standalone HTTP servers.
JavaScript
1
star