NetworkGhost
IS-IT--Management
Got a problem Im trying to work through. I have 2 separate functions for the opening and closing of all images. I am trying to change the -/+ to match on the on the individual a tags when I use the all function. Clicking ion the indiviudal links is works find. When I try the link to close or open all the innerhtml is not changing. Help is appreciated.
Free Firewall/Network/Systems Support-
Code:
<script type="text/javascript">
function hide(individualImage) {
var objID = "individualImage"
if (individualImage != '') {
var hide = [document.getElementById(individualImage)]
var objID= "link_" + individualImage
var head = document.getElementById(objID)
}
for (i=0; i<hide.length; i++) {
if (hide[i].style.display == 'none') {
hide[i].style.display = 'inline'
head.innerHTML = head.innerHTML.replace("[+] Show Image","[-] Hide Image")
} else {
hide[i].style.display = 'none'
head.innerHTML = head.innerHTML.replace("[-] Hide Image","[+] Show Image")
}
}
}
function all_open(imageGroup) {
var objID = "grouplink"
if (imageGroup != '') {
var hide = document.getElementsByName(imageGroup);
}
for (i=0; i<hide.length; i++) {
if (hide[i].style.display == 'none') {
hide[i].style.display = 'inline'
hide[i].innerHTML = hide[i].innerHTML.replace("[+] Show Image","[-] Hide Image")
}
}
}
function all_close(imageGroup) {
var objID = "grouplink"
if (imageGroup != '') {
var hide = document.getElementsByName(imageGroup);
}
for (i=0; i<hide.length; i++) {
if (hide[i].style.display == 'inline') {
hide[i].style.display = 'none'
hide[i].innerHTML = hide[i].innerHTML.replace("[-] Hide Image","[+] Show Image")
}
}
}
</script>
<a onclick="all_open('a');" id="grouplink">Show Images <font color="red">[ASDM]</font></a> | <a onclick="all_close('a');" id="grouplink">Hide Images <font color="red">[ASDM]</font></a>
<br>
This is Image 1:<br>
<hr>
<a onclick="hide('a1');" id="link_a1">[+] Show Image</a>
<br>
<img style="display: none" name="a" id="a1" src="datetime.bmp" border="0">
<br>
This is Image 2:<br>
<hr>
<br>
<a onclick="hide('a2');" id="link_a2">[+] Show Image</a>
<br>
<img style="display: none" name="a" id="a2" src="datetime.bmp" border="0">
Free Firewall/Network/Systems Support-