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.
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
.