iphone's safari touchmove event not working

前端 未结 2 818
一整个雨季
一整个雨季 2020-12-08 23:18

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

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


        
2条回答
  •  渐次进展
    2020-12-08 23:36

    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

提交回复
热议问题