$('.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--;
}
}
})
一杯2块的奶茶