Adding Touch Support to jQuery-UI Interfaces
Today I stumbled upon a jQuery-UI plugin that adds support for touch events to all your jQuery-UI widgets – out of the box! It’s so easy to install that it will give you the this-is-a-miracle feeling when you test it on a touch screen.
It’s called jQuery-UI Touch Punch and was developed by David Furfero.
It is worth explaining how it works. Unlike other plugins that help you simulate touch events with your mouse, this one does the opposite: it turns your touch events into mouse events. And that’s what allows your widgets to work without additional code: as far as they’re concerned, you’re using a mouse and not your thumb.
So here is the little miracle worker on Github: https://github.com/furf/jquery-ui-touch-punch/blob/master/jquery.ui.touch-punch.js
Don’t forget to thank @Dave Furf!
UPDATE: the plugin now has its own webpage, visit it at http://touchpunch.furf.com/
Nice find Gabriel. Although it is fantastic, for people really trying to keep their code to a minimum this solution is pretty good. He basically teaches you to variate your binds depending on what type of device you use. Link here for anyone who is interested
http://hankchizljaw.co.uk/tutorials/make-your-mouse-events-touch-friendly-with-jquery-tutorial/28/04/2012/
Thanks for stopping by Andy and for the link to that explanation!
Very nice! thank you for sharing this.