TheConeHead
Programmer
When I need to show a dive and hide the rest I usually do something like:
<head>
<script>
function show(which) {
switch(which) {
case "1" :
......visibility = "visible";
......visibility = "hidden";
break;
case "2" :
......visibility = "hidden";
......visibility = "visible";
break;
}
}
</head>
<body>
<div id="1">
</div>
<div id="2">
</div>
<a href="#" onclick="show('1')">1</a>
<a href="#" onclick="show('2')">2</a>
How could I do this more quickly and cleanly?
![[conehead] [conehead] [conehead]](/data/assets/smilies/conehead.gif)
<head>
<script>
function show(which) {
switch(which) {
case "1" :
......visibility = "visible";
......visibility = "hidden";
break;
case "2" :
......visibility = "hidden";
......visibility = "visible";
break;
}
}
</head>
<body>
<div id="1">
</div>
<div id="2">
</div>
<a href="#" onclick="show('1')">1</a>
<a href="#" onclick="show('2')">2</a>
How could I do this more quickly and cleanly?
![[conehead] [conehead] [conehead]](/data/assets/smilies/conehead.gif)