这里为什么要用switch语句,如果用if语句怎么写呢?
if(index == 0){
$(this).fadeTo(500,0.3);
}else if (index == 1){
$(this).fadeTo(500,0.5);
}else if (index == 2){
$(this).fadeTo(500,0.7);
}这里为什么要用switch语句,如果用if语句怎么写呢? 我这样写不知道为什么就不对了
if(index == 0){
$(this).fadeTo(500,0.3);
}else if (index == 1){
$(this).fadeTo(500,0.5);
}else if (index == 2){
$(this).fadeTo(500,0.7);
}这里为什么要用switch语句,如果用if语句怎么写呢? 我这样写不知道为什么就不对了
2016-02-28
举报