Hi,
Im try to create a cascade of information using plus and minus images.
intImage = 2;
function swapImage(name, src) {
switch (intImage) {
case 1:
document.images[name].src = "images/plus.gif"
intImage = 2
return(false);
case 2:
document.images[name].src = "images/minus.gif"
intImage = 2
return(false);
}
}
The function on called from this code with the id and name for each heading. onclick i display or hide additional info
<img id="IMG1" name="IMG1" src="images/plus.gif" onClick="swapImage(name, src);"> text here
<img id="IMG2" name="IMG2" src="images/plus.gif" onClick="swapImage(name, src);"> text here
This works apart from when i click another image the image sometimes does not change depending on what image was clicked before. How can i get each plus/minus to function separately??
Im try to create a cascade of information using plus and minus images.
intImage = 2;
function swapImage(name, src) {
switch (intImage) {
case 1:
document.images[name].src = "images/plus.gif"
intImage = 2
return(false);
case 2:
document.images[name].src = "images/minus.gif"
intImage = 2
return(false);
}
}
The function on called from this code with the id and name for each heading. onclick i display or hide additional info
<img id="IMG1" name="IMG1" src="images/plus.gif" onClick="swapImage(name, src);"> text here
<img id="IMG2" name="IMG2" src="images/plus.gif" onClick="swapImage(name, src);"> text here
This works apart from when i click another image the image sometimes does not change depending on what image was clicked before. How can i get each plus/minus to function separately??