圖片輪播與點擊事件結合起來,挺麻煩的,應該還有更簡單的方法,但這比以前寫的好多了c++
c=1;
x=1;
prev.click(function(){
if(c!=3){
da1.stop();
da1.animate({marginLeft:c*(-1100)+"px"},
500,
function(){
c++;
})
}
})
next.click(function(){
if(c!=1){
da1.stop();
da1.animate({marginLeft:(c-2)*(-1100)+"px"},
500,
function(){
c--;
})
}
})
c3.click(function(){
prev.click(function(){
if(x!=2){
da3.stop();
da3.animate({marginLeft:x*(-1100)+"px"},
500,
function(){
x++;
})
}
})
})
c3.click(function(){
next.click(function(){
if(x!=1){
da3.stop();
da3.animate({marginLeft:(x-2)*(-1100)+"px"},
500,
function(){
x--;
})
}
})
})事件