NetworkGhost
IS-IT--Management
Through some searching on the internet I have been able to find some good help on a collapse/expand script. What I would like to do is enhance a little while keeping the script as short as possible. I would like to still be able to collapse/expand all and also collapse or expand individual images. I figured this would have to be done by dynamically assigning ids a1, a2, a3 etc... and to also be able to perform the collapse/expand all function with a wilcard for teh generated ids a*. Anyone have a script for this? Short an sweet? Thanks for the help.
Free Firewall/Network/Systems Support-
Code:
<script>
function hide(which) {
var hide = new Array();
hide = document.getElementsByName(which);
for (i=0; i<hide.length; i++) {
hide[i].style.display = 'none';
}
}
function show(which) {
var hide = new Array();
hide = document.getElementsByName(which);
for (i=0; i<hide.length; i++) {
hide[i].style.display = 'inline';
}
}
</script>
<a href="#" onclick="show('a');">Show A</a> | <a href="#" onclick="hide('a');">Hide A</a>
<br>
<br>
This is Image 1:<br>
<hr>
<img name="a" src="image1.gif" border="0">
<br>
This is Image 2:<br>
<hr>
<img name="a" src="Image2.gif" border="0">
Free Firewall/Network/Systems Support-