function showDiv(dvnm)
{
document.getElementById(dvnm).style.display = 'block';
document.getElementById(dvnm).style.visibility = 'visible';
}
function hideDiv(dvnm)
{
document.getElementById(dvnm).style.display = 'none';
document.getElementById(dvnm).style.visibility = 'hidden';
}
function showlayer(n)
{
for(i=1;i<=2;i++)//number of layer u want to show
{
if(i==n)
{
showDiv('div'+ i);//dynamically call div id
document.getElementById('tab'+i).style.backgroundColor="#666666";//dynamically show contant id
}
else
{
hideDiv('div'+ i);
document.getElementById('tab'+i).style.backgroundColor="gray";
}
}
}
No comments :
Post a Comment