come on 为难道老师们讲课之前不进行调试代码吗
这个案例在移动端效果都出来,全是bug,,,,,
这个案例在移动端效果都出来,全是bug,,,,,
2015-08-15
//这个是加上去的
.large {
overflow: hidden;
}
//这个是修改后的
$('#large_container').swipeLeft(function(){
if(lock){
return;
}
cid++;
lock =true;
if (cid <= total) {
loadImg(cid,function(){
domImage.addEventListener('webkitAnimationEnd',function(){
wImage.removeClass('animated bounceInRight');
domImage.removeEventListener('webkitAnimationEnd');
lock = false;
},false);
wImage.addClass('animated bounceInRight');
});
} else {
cid = total;
lock = false;
}
});
$('#large_container').swipeRight(function(){
if(lock){
return;
}
cid--;
lock =true;
if(cid>0){
loadImg(cid,function(){
domImage.addEventListener('webkitAnimationEnd',function(){
wImage.removeClass('animated bounceInLeft');
domImage.removeEventListener('webkitAnimationEnd');
lock = false;
},false);
wImage.addClass('animated bounceInLeft');
});
}else{
cid = 1;
lock = false;
}
});
整体看, 老师的思路, 想法很不错, 如果你完全理解了, 这点bug还是能修改的, 不过代码冗余性还是有的,比如zWin.width(), $('#container'), 这种重复获取的, 声明一下, 直接调用就好了!
老师领进门, 剩下的代码优化等等应该自己完成.举报