Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
159
rated 0 times [  160] [ 1]  / answers: 1 / hits: 36496  / 14 Years ago, fri, august 20, 2010, 12:00:00

i am using jquery and touchmove event but the code is not showing anything in #info



$('#movieShow').bind('touchmove',function(e){                   
e.preventDefault();
$('#info').text(e.touches[0].pageX);
});

More From » jquery

 Answers
13

Try using e.originalEvent.touches:



$('#movieShow').bind('touchmove',function(e){
e.preventDefault();

var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
console.log(touch.pageX);
});


I ran into a similar problem when I was playing around with touch events and jquery: http://xavi.co/articles/trouble-with-touch-events-jquery


[#95860] Tuesday, August 17, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jananauticat

Total Points: 1
Total Questions: 105
Total Answers: 95

Location: Azerbaijan
Member since Fri, May 12, 2023
1 Year ago
;