图片轮播与点击事件结合起来,挺麻烦的,应该还有更简单的方法,但这比之前写的好多了

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--;
})
}
})
})

相关文章:

  • 2021-10-07
  • 2021-12-08
  • 2021-11-22
  • 2021-11-27
  • 2021-10-04
  • 2021-12-12
  • 2021-11-27
  • 2020-03-17
猜你喜欢
  • 2021-08-14
  • 2021-12-07
  • 2021-09-27
  • 2021-12-02
  • 2021-09-25
  • 2021-12-02
  • 2021-12-08
相关资源
相似解决方案