Javascript/menu
Expert: Rick Johnson - 5/8/2004
Question Hi,
I have a script (you can find the script below) that does the following:
A picture is diplayed. When user moves the mouse over it, it becomes a selection table. User can now click on the link and go to other pages. When user moves the mouse out of the table (and does not click)the selction table is replaced with the original picture.
Problem: The script works fine with IE but not with Netscape. The more precise problem seems to be the fact that although I specify the picture and selection table to be the same size, Netscape makes the selection table a lot smaller than I specified. As a result of that the mouse is confused about the picture/table boundaries. Natscape also shrinks and displaces the table background. Could you help me. Thanks. Sebastian.
<HTML><TABLE><TR>
<TD WIDTH="26%" ALIGN="CENTER">
<IMG SRC="alaskaicon1.jpg" id="myAlaskaIcon" ALT="ALASKA" WIDTH=210 HEIGHT=140 onMouseOut="showAlaskaPicture()" onMouseOver="showAlaskaTable1()">
<table BGCOLOR="#CCCC99" id="myAlaskaTable1" border="1" WIDTH=210 HEIGHT=140 onMouseOut="showAlaskaPicture()" onMouseOver="showAlaskaTable1()">
<tr> <TD WIDTH=30</TD><td><A HREF="ALASKA/ALASKA1.HTM"> <FONT FACE="ARIAL" SIZE="3"><B> Places and people </B></FONT></A></td></tr>
<tr> <TD WIDTH=30</TD><td><A HREF="WILDAN/WILDAN1.HTM"> <FONT FACE="ARIAL" SIZE="3"><B> Alaska wildlife </B></FONT></A></td></tr>
</table>
<script>
document.getElementById("myAlaskaTable1").style.display = "none";
function showAlaskaTable1(){
document.getElementById("myAlaskaIcon").style.display = "none";
document.getElementById("myAlaskaTable1").style.display = "inline";
}
function showAlaskaPicture(){
document.getElementById("myAlaskaTable1").style.display = "none";
document.getElementById("myAlaskaIcon").style.display = "inline";
}
</script>
</TD></TR></TABLE></HTML>
AnswerSebastian,
Frankly I do not have time to write or debug code by questioners. I have written a number of JavaScript applications that address the most frequently asked questions.
Writing to a division/layer is one such script that I have written. See the following URL:
http://209.48.113.164/myPage/javas93.htm
I hope this helps,
Rick Johnson