"touchmove" event on Android &iPhone using PhoneGap

Petar Vasilev picture Petar Vasilev · Feb 17, 2013 · Viewed 14.4k times · Source

so basically I want to be able to get the coordinates of the touch when someone swipes across the screen of a touch-enable device powered by iOS or Android.

What I've tried to do so far is as follows.

$('element').bind("touchmove", function(e) {
    $(element2).html(e.pageX + "," + e.pageY);
}

plus I've tried the same with "vmousemove"(the jquery mobile equivalent or so it should be), "mousemove" but to no avail. I only get the coordinates of the the initial and end touch.

Thanks in advance

Answer

Vlad Stirbu picture Vlad Stirbu · Feb 17, 2013

iOS and Android are muti-touch devices. The interaction is handled using touch events:

https://developer.mozilla.org/en-US/docs/DOM/Touch_events