EmC
2006-04-05, 19:49
I am trying to use JavaScript to alternate the visibility of two divs on my pages. So far i have this code,
<script language="JavaScript">
function toggleVisibility(hide, show){
show.style.visibility="visible";
hide.style.visibility="hidden";
}
function hideOnLoad(hide){
hide.style.visibility="hidden";
}
</script>
I have two images one named Artifact 1 and the other Artifact 2. When I click them I want them to show the appropriate div, "Artifact 1" or "Artifact 2."
So I have this in the HTML,
<td width="340"><img style="border:0px" src="images/artifact1_172_74.png" alt="" width="172" height="74" onclick="toggleVisibility(Artifact2,Artifact1)"/></td>
<td width="340"><img style="border:0px" src="images/artifact2_172_74.png" alt="" width="172" height="74" onclick="toggleVisibility(Artifact1,Artifact2)"/></td>
It works in IE and Safari, but not FireFox. Is there anything I am missing. I know nothing about JavaScript and I pieced this together on a trial and error type learning experience.
One of the pages this is on is Performace Standard 7 (http://www.ecarlsen.com/portfolio/ps/ps7.html) if you check with FireFox or Camino it does not work, Safari does.
<script language="JavaScript">
function toggleVisibility(hide, show){
show.style.visibility="visible";
hide.style.visibility="hidden";
}
function hideOnLoad(hide){
hide.style.visibility="hidden";
}
</script>
I have two images one named Artifact 1 and the other Artifact 2. When I click them I want them to show the appropriate div, "Artifact 1" or "Artifact 2."
So I have this in the HTML,
<td width="340"><img style="border:0px" src="images/artifact1_172_74.png" alt="" width="172" height="74" onclick="toggleVisibility(Artifact2,Artifact1)"/></td>
<td width="340"><img style="border:0px" src="images/artifact2_172_74.png" alt="" width="172" height="74" onclick="toggleVisibility(Artifact1,Artifact2)"/></td>
It works in IE and Safari, but not FireFox. Is there anything I am missing. I know nothing about JavaScript and I pieced this together on a trial and error type learning experience.
One of the pages this is on is Performace Standard 7 (http://www.ecarlsen.com/portfolio/ps/ps7.html) if you check with FireFox or Camino it does not work, Safari does.