Forum Moderators: open
<script type="text/javascript">
<!--
function toggle_one() {
hk_female1.style.display = "";
hk_female2.style.display = 'none';
hk_male.style.display = 'none';
return true;
}
function toggle_two() {
hk_female1.style.visibility = 'none';
hk_female2.style.visibility = "";
hk_male.style.visibility = 'none';
return true;
}
function toggle_three() {
hk_female1.style.display = 'none';
hk_female2.style.display = 'none';
hk_male.style.display = "";
}
//-->
</script>
here's how i call it:
<a onmouseover="this.style.cursor='pointer'" onmouseout="this.style.cursor='default'" onclick="toggle_one();"><img src="ONE.gif"></a> <a onmouseover="this.style.cursor='pointer'" onmouseout="this.style.cursor='default'" onclick="toggle_two();"><img src="TWO.gif"></a> <a onmouseover="this.style.cursor='pointer'" onmouseout="this.style.cursor='default'" onclick="toggle_three();"><img src="THREE.gif"></a>
basically it's to toggle the display of 3 divs on and off, as you'd have expected.
it works well under Safari, and also on Firefox 2.0.0.1 when i view it as a html file offline.
however when i upload it to my webserver, this doesn't work anymore on Firefox 2.0.0.1, but Safari is still okay.
I wonder why is there a difference when i upload it to the webserver, and when i view it on my computer offline?
Seems like some specific code, does anybody have any idea?
Any help is appreciated. thanks!
i managed to track down that it one of the elements i tried to change was undeclared..
i guess i cant reference objects directly in the way of:
hk_female.style.display = ...
insteady i had to do a:
document.getElementId("hk_female").style.display = ...
this works correctly now in FF 2.0.0.1 and Safair. Thanks!