ios6触摸事件处理javascript [英] ios6 touch event handling javascript

查看:112
本文介绍了ios6触摸事件处理javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力改进touchwipe js。我想要只进行水平滚动,如果它的任何垂直滚动出现,让浏览器处理我的修复工作在ios5中工作正常,但在ios6中它的frezee任何想法?

I am trying to improve the touchwipe js. where i want to hanlde only horizontal scroll and if its any vertical scrolling comes up let browser handle my fix works fine in ios5 but in ios6 its getting frezee any idea ?

< a href =http://archive.plugins.jquery.com/project/Touchwipe-iPhone-iPad-wipe-gesture =nofollow> http://archive.plugins.jquery.com/project/Touchwipe- iPhone-iPad-wipe-gesture

请在以下代码中找到代码

Please find code following

function onTouchMove(e) {   

         //var e = (e.changedTouches != undefined)? touches[0] : e; 
         if(isMoving) {              
             var x = e.touches[0].pageX;
             var dx = startX - x;
             if(Math.abs(dx) >= config.min_move_x)
             {
                 if(config.preventDefaultEvents) { 
                     e.preventDefault();                 
                 }
                cancelTouch();
                if(dx > 0) {
                    config.wipeLeft();
                }
                else {
                    config.wipeRight();
                }
                return false;
            }
             else {
                   console.log('y moving.. ');
                   // attachTouch();
                    return true;
             }
         }

     }

只需添加更多细节。
我试图通过BXslider设置我的列表水平动画,并且其工作正常,希望支持触摸事件,因此添加了触摸擦除jquery。但添加它给出1个问题,即水平滚动动画工作正常,但触摸页面垂直滚动不起作用。

Just adding some more details . I am trying to animate my list horizontal by BXslider and its works fine want to support the touch events so added the touch wipe jquery . But adding it give 1 issue that's horizontal scroll animation works ok but touch page vertical scroll not works.

所以我试图修复问题,返回true;如果它只有Y移动,在touchwipe js。这个解决方案在android4和ios5上工作正常,但在ios6中失败,如果我垂直滚动我的页面积极地(在椭圆/圆圈中移动手指4-5秒)其freez bxslider动画。

So i tried to fixed issue by return true; if its only Y move, at touchwipe js. This fix working fine on android4 and ios5 but fails in ios6 if i scroll my page vertically little aggressively(moving finger in oval/circle for 4-5 sec) its freez bxslider animation.

进一步调试内部bxslider.gotoNextSlide() - >调用Jquery $ parent.animate()方法进行滑动,在积极滚动后停止在ios6中工作。

further debugging give inside that bxslider.gotoNextSlide()-> calling the Jquery $parent.animate() method for sliding which stop working in ios6 after aggressive scroll.

现在我陷入困境,无法理解为什么这个animate()停止工作?

Now i m stuck and not able to understand why this animate() stops working ??

EG >>>

http://jsfiddle.net/qtCHx/

推荐答案

这可能是由于这个错误造成的:
http://bugs.jquery.com/ticket/12620

This probably happens due to this bug: http://bugs.jquery.com/ticket/12620

此处的临时解决方案:
https://gist.github.com/3798925

A temporary solution here: https://gist.github.com/3798925

这篇关于ios6触摸事件处理javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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