cou*_*011 12 javascript iphone safari jquery
我正在使用jquery和touchmove事件,但代码没有在#info中显示任何内容
$('#movieShow').bind('touchmove',function(e){
e.preventDefault();
$('#info').text(e.touches[0].pageX);
});
Run Code Online (Sandbox Code Playgroud)
Xav*_*avi 37
尝试使用e.originalEvent.touches:
$('#movieShow').bind('touchmove',function(e){
e.preventDefault();
var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
console.log(touch.pageX);
});
Run Code Online (Sandbox Code Playgroud)
当我玩触摸事件和jquery时,我遇到了类似的问题:http://xavi.co/articles/trouble-with-touch-events-jquery