iphone的safari touchmove活动无法正常工作 [英] iphone's safari touchmove event not working

查看:94
本文介绍了iphone的safari touchmove活动无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jquery和touchmove事件,但代码没有显示在#info

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);
});         


推荐答案

尝试使用 e.originalEvent .touches

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

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

当我玩触摸事件和jquery时,我遇到了类似的问题: http://xavi.co/articles/trouble-with-touch-events-jquery

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

这篇关于iphone的safari touchmove活动无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆