Javascript/menu

Advertisement


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>

Answer
Sebastian,

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

Javascript

All Answers


Answers by Expert:


Ask Experts

Volunteer


Rick Johnson

Expertise

I consider myself knowledgeable in JavaScript and HTML. I hold BS in computer science and an MS in information systems. I formally managed a group that was responsible for all PCs in the worldwide research center of Kraft Food Inc. located in Glenview, Illinois. The company I currently own designs web pages for local, regional and national businesses. Many of the questions I have received required some research. This is good because it causes me to expand on my existing knowledge.

©2012 About.com, a part of The New York Times Company. All rights reserved.