touchXXX监听导致animate失去作用

新手上路,请多包涵

chrome模拟移动端,
当页面中存在监听touchXXXd的方法,
在触发touchmove之后(无论存不存在touchmove监听)
$.animate()动画失效;
当页面中不存在监听touchXXXd的方法,
无论有无触发touchmove
$.animate()动画正常;

当执行touchstart,touchend(即点击)之后,
$.animate()动画恢复正常,

//执行动画
$('._tab_body_box').animate({scrollLeft: leftpx}, 300,'swing',function(){
    $(this).attr('isSwitch',false)
})
//绑定事件
        bindEvent:function(obj,args){
            return (function(){
                // obj.on("touchmove","."+args.name+" ._tab_body_item",function(el){
                //     var _el = $(el.currentTarget);
                //     if(typeof(args.onClick)=="function"){
                //         args.onTouch(_el);
                //     }
                // });
                var dom = document.getElementById(args.name)
                dom.addEventListener("touchstart",function(el){
                    var _el = $(el);
                    if(typeof(args.onTouch)=="function"){
                        args.onTouch(_el);
                    }
                });
                dom.addEventListener("touchmove",function(el){
                    var _el = $(el);
                    if(typeof(args.onTouch)=="function"){
                        args.onTouch(_el);
                    }
                });
                dom.addEventListener("touchend",function(el){
                    var _el = $(el);
                    if(typeof(args.onTouch)=="function"){
                        args.onTouch(_el);
                    }
                });
                dom.addEventListener("touchcancel",function(el){
                    var _el = $(el);
                    if(typeof(args.onTouch)=="function"){
                        args.onTouch(_el);
                    }
                // });
            })();
        },

图片描述

阅读 845
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题