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);
}
// });
})();
},