".dib_box_xun").eq(1).addClass("next"); $(".dib_box_xun").eq(2).addClass("prev"); } $(".dib_arrow_left").click(function(){ ind=$(".dib_box_xun.on").index(); if(len>3){ if(ind==0){ ind=1;//1 next=2;//5 prev=0;//2 }else if(ind==len-1){ ind=0; next=1; prev=len-1; }else if(ind==len-2){ ind=len-1; next=0; prev=len-2; }else{ ind=ind+1; next=ind+1; prev=ind-1; } }else{ if(ind==0){ ind=1;//1 next=2;//5 prev=0;//2 }else if(ind==1){ ind=2; next=0; prev=1; }else if(ind==2){ ind=0; next=1; prev=2; } } qiehuan(ind,next,prev); }); $(".dib_arrow_right").click(function(){ ind=$(".dib_box_xun.on").index(); if(len>3){ if(ind==len-1){ ind=len-2; next=len-1; prev=len-3; }else{ ind=ind-1; next=ind+1; prev=ind-1; } }else{ if(ind==0){ ind=2;//1 next=0;//5 prev=1;//2 }else if(ind==1){ ind=0; next=1; prev=2; }else if(ind==2){ ind=1; next=2; prev=0; } } qiehuan(ind,next,prev); }); $(".dib_box_xun").click(function(){ var onind=$(this).index(); ind=$(".dib_box_xun.on").index(); if(onind>ind&&onind!=0&&onind!=len-1){ if(ind==0){ ind=1;//1 next=2;//5 prev=0;//2 }else if(ind==len-1){ ind=len-1; next=0; prev=len-2; }else if(ind==len-2){ ind=len-1; next=0; prev=len-2; }else{ ind=ind+1; next=ind+1; prev=ind-1; } }else if(onind