Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 ?

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

     }

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.

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.

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

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

EG >>>

http://jsfiddle.net/qtCHx/

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
208 views
Welcome To Ask or Share your Answers For Others

1 Answer

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...