Sunday, February 05, 2012

ios - jQuery Mobile Iphone application - Stack Overflow

ios - jQuery Mobile Iphone application - Stack Overflow: "
Some events you missed on the Event page of the jQuery Mobile Documentation are the virtual events: http://jquerymobile.com/demos/1.0/docs/api/events.html

vmousedown
    Normalized event for handling touchstart or mousedown events

vmousemove
    Normalized event for handling touchmove or mousemove events

vmouseup
    Normalized event for handling touchend or mouseup events

vmousecancel
    Normalized event for handling touch or mouse mousecancel events
I would use the vmousedown event to start tracking the cursor's movement, vmousemove to continue tracking the path of the cursor, and vmouseup to finish tracking the cursor's movement.

A simple example would be:

//setup a variable to store the cursor's movement
var tracks = [];

//bind to the three events described above
$(document).bind('vmousedown vmousemove vmouseup', function (event) {

    //check to see what event is being fired
    if (event.type == 'vmousedown') {
"

'via Blog this'