为了账号安全,请及时绑定邮箱和手机立即绑定

左右滑动使 click事件失效

左右滑动使 click事件失效

qq_云里看雾_0 2016-05-07 13:51:38
$('.col-wenzi').bind('click',function(e){         leftorright=$(this).index();        $(this).siblings().removeClass('active');        $(this).addClass('active');        $(".cm-content-all").hide().eq($('.col-wenzi').index(this)).show();     });  $('.xl-top').bind('touchstart',function(i){        starttopX = (i.originalEvent.targetTouches[0].pageX); i.preventDefault();    });$(".xl-top").bind('touchend',function(e){        var endX = (e.originalEvent.changedTouches[0].pageX);        var offset=endX-starttopX;        if (offset<=-30) { e.preventDefault(); top_index++; if(top_index<=max-4){ $('.col-wenzi').eq(top_index-top_off).css('display','none');   $('.col-wenzi').eq(top_index+4).show(); } else top_index--; }        else if (offset>=30){ e.preventDefault(); if(top_index!=0){ $('.col-wenzi').eq(top_index-top_off).show();   $('.col-wenzi').eq(top_index+4).css('display','none'); top_index--;        }        }    })
查看完整描述

1 回答

?
一杯2块的奶茶

TA贡献226条经验 获得超75个赞

没有html代码吗

查看完整回答
反对 回复 2016-05-09
  • 1 回答
  • 0 关注
  • 1463 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信