Skip to content Skip to sidebar Skip to footer

Touchmove With Phonegap

I'm really struggling on an Android app in Phonegap and JQuery. All I want to do is bind a touchmove to an element and then check the X and Y coordinates as I move my finger (a dra

Solution 1:

Here the reference for mobile safari (android is basically the same):

https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html

what you want is:

var x = event.touches[0].pageX;
var y = event.touches[0].pageY;

If you are running on android you also need to cancel the touchmove event to get new ones while touching. Don't ask me why...

Post a Comment for "Touchmove With Phonegap"