chrome simulates the mobile end,
when there is a method to listen to touchXXXd in the page,
after touchmove is triggered (regardless of whether there is touchmove listening)
$.animate () the animation is invalid;
when there is no way to listen to touchXXXd in the page,
whether or not touchmove
$.animate () animation is triggered or not is normal;
when touchstart,touchend is executed (that is, click),
$.animate () animation returns to normal,
//
$("._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);
}
// });
})();
},