日期:2014-05-16  浏览次数:20411 次

JavaScript的swichcase方法

function changeBody(index){  
switch(index){  
case 1:{  
document.getElementById('bull').style.display = "";  
document.getElementById('cont').style.display = "none";  
document.getElementById('gridPager').style.display = "none";
document.getElementById('dis').style.display = "none";
break;  
    }  
case 2:{  
document.getElementById('bull').style.display = "none";  
document.getElementById('cont').style.display = "";  
document.getElementById('gridPager').style.display = "";
document.getElementById('dis').style.display = "";
break;  
    }  
case 3:{  
document.getElementById('bull').style.display = "none";  
document.getElementById('cont').style.display = "";  
document.getElementById('gridPager').style.display = "";
document.getElementById('dis').style.display = "";
break;  
    } 

   }
}