Template:Iitm/clickhiding

From 2010.igem.org

(Difference between revisions)
 
(6 intermediate revisions not shown)
Line 3: Line 3:
<script language=javascript type='text/javascript'>
<script language=javascript type='text/javascript'>
-
function showDiv(pass) {
+
function showhide(id, visibility) {
-
var divs = document.getElementsByTagName('div');
+
document.getElementById(id).style.display = visibility;
-
for(i=0;i<divs.length;i++){
+
-
if(divs[i].id.match(pass)){//if they are 'see' divs
+
-
if (document.getElementById) // DOM3 = IE5, NS6
+
-
divs[i].style.visibility="visible";// show/hide
+
-
else
+
-
if (document.layers) // Netscape 4
+
-
document.layers[divs[i]].display = 'visible';
+
-
else // IE 4
+
-
document.all.divs[i].visibility = 'visible';
+
-
} if(divs[i].id.match(hide_)){
+
-
if (document.getElementById)
+
-
divs[i].style.visibility="hidden";
+
-
else
+
-
if (document.layers) // Netscape 4
+
-
document.divs[i].visibility = 'hidden';  
+
-
else // IE 4
+
-
document.all.divs[i].visibility = 'hidden';
+
-
}
+
-
}
+
}
}
 +
</script>
</script>
</head>
</head>
</html>
</html>

Latest revision as of 21:48, 27 October 2010

clickhiding>