O'Reilly logo

jQuery Mobile Cookbook by Chetan K Jain

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Virtual mouse events

The jQuery Mobile framework provides virtual mouse or vmouse events to abstract the mouse and touch events.

You don't have to write separate handlers for the touch and mouse events for each of the supported platforms or devices. You just have to write the event handlers for the vmouse events and this will work across various platforms. There are seven vmouse events supported by the framework: vmousemove , vmouseover , vmouseout , vmousedown , vmouseup , vclick , and vmousecancel . This recipe shows you how to use these vmouse events.

Getting ready

Copy the full code of this recipe from the code/08/vmouse sources folder. You can launch this code by using the URL http://localhost:8080/08/vmouse/main.html.

How to do it... ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required