While this code produces the expected behavior of "1" when touching the screen:
document.getElementById('someNodeId').addEventListener('touchmove', touch, true);
function touch(evt) {
evt.preventDefault();
alert(evt.changedTouches.length);
}
the same code using a jQuery selector:
$('#someNodeId').bind('touchmove', touch);
produces the error: "TypeError: Result of expression 'evt.changedTouches'[undefined] is not an object".
(Device = iPod Touch OS 3.1.3 (7E18); jQuery 1.4.2).
How is this possible and what am I doing wrong?
I use this simple function for JQuery based project
example:
hope this will be usefull for you ;)
Try