My script won't work with NS.. only with IE - My onMouseOut and onMouseOver script only works with I

They have: 7 posts

Joined: Aug 1999

this code looks to me to be just right, but it doesn't seem to work in NS... any ideas why????

here's the code...
<script language="JavaScript">
<!--
// preload images:
if (document.images) {
button1 = new Image(125,20); button1.src = "images/button1.gif";
button1a = new Image(125,20); button1a.src = "images/button1a.gif";
button2 = new Image(125,20); button2.src = "images/button2.gif";
button2a = new Image(125,20); button2a.src = "images/button2a.gif";
button3 = new Image(125,20); button3.src = "images/button3.gif";
button3a = new Image(125,20); button3a.src = "images/button3a.gif";
button4 = new Image(125,20); button4.src = "images/button4.gif";
button4a = new Image(125,20); button4a.src = "images/button4a.gif";
button5 = new Image(125,20); button5.src = "images/button5.gif";
button5a = new Image(125,20); button5a.src = "images/button5a.gif";
button6 = new Image(125,20); button6.src = "images/button6.gif";
button6a = new Image(125,20); button6a.src = "images/button6a.gif";
}

function hiLite(imgName,imgObjName) {
if (document.images) {
document.images[imgName].src = eval(imgObjName + ".src");
}
}

-->
</script>
</head>

<body bgcolor="#3333cc" onLoad="window.status='This webpage designed and maintained by Dave Hartmann of Encom Consulting.'" text="#ffffff">
<table width="100%">
<tr>
<td align="center" width="100%"><img src="images/encom.gif"><br>
<br></td>
</tr>
<tr>
<td align="center" width="100%">
<a href="rightframe.html" target="b" onMouseOver="hiLite('img01','button1a')" onMouseOut="hiLite('img01','button1')"><img src="images/button1.gif" width="125" height="20" name="img01" border="0"></a></td>
</tr>
<tr>
<td align="center" width="100%">
<a href="products.htm" target="b" onMouseOver="hiLite('img02','button2a')" onMouseOut="hiLite('img02','button2')"><img src="images/button2.gif" width="125" height="20" name="img02" border="0"></a></td>
</tr>
<tr>
<td align="center" width="100%">
<a href="services.htm" target="b" onMouseOver="hiLite('img03','button3a')" onMouseOut="hiLite('img03','button3')"><img src="images/button3.gif" width="125" height="20" name="img03" border="0"></a></td>
</tr>
<tr>
<td align="center" width="100%">
<a href="ordering.htm" target="b" onMouseOver="hiLite('img04','button4a')" onMouseOut="hiLite('img04','button4')"><img src="images/button4.gif" width="125" height="20" name="img04" border="0"></a></td>
</tr>
<tr>
<td align="center" width="100%">
<a href="about.htm" target="b" onMouseOver="hiLite('img05','button5a')" onMouseOut="hiLite('img05','button5')"><img src="images/button5.gif" width="125" height="20" name="img05" border="0"></a></td>
</tr>
<tr>
<td align="center" width="100%">
<a href="mailto:[email protected]" onMouseOver="hiLite('img06','button6a')" onMouseOut="hiLite('img06','button6')"><img src="images/button6.gif" width="125" height="20" name="img06" border="0"></a>

----------
Best Wishes and Tuna Fishes

They have: 268 posts

Joined: May 1999

I believe that document.images is an IE only tag.
Try this for your preload

<!--
browserName=navigator.appName;
browserVer=parseInt(navigator.appVersion);

if ((browserName=="Netscape" && browserVer>=3) ¦¦ (browserName=="Microsoft Internet Explorer" && browserVer>=4))
version="n3";
else
version="n2";

if (version=="n3")
{
button1= new Image(259,26);
button1.src="Images/Coup/Bead1x.GIF";

Hope this works for you.

----------
My goal in life is found in Phillipians 4:8-9

My goal in life is found in Phillipians 4:8-9
shoutingrock.org/troop214

They have: 7 posts

Joined: Aug 1999

I don't think that was it... I went to a site that used document.images and it worked fine with my NS...

any other suggestions???

----------
Best Wishes and Tuna Fishes

They have: 7 posts

Joined: Aug 1999

I don't think just that will do it, cuz the document.images is used in the hiLite function as well...

but, I don't think that was it... I went to a site that used document.images and it worked fine with my NS...

any other suggestions???

----------
Best Wishes and Tuna Fishes

They have: 7 posts

Joined: Aug 1999

I don't think just that will do it, cuz the document.images is used in the hiLite function as well...

but, I don't think that was it... I went to a site that used document.images and it worked fine with my NS...

any other suggestions???

----------
Best Wishes and Tuna Fishes

They have: 5,633 posts

Joined: Jan 1970

I have also had this problem. My code works fine in IE on MAC and PC but Netscape on both platforms only works with the top button. (which blows the whole IE script only suggestion away. I thought it was that too at first.) Check it out. any suggestions would be welcome.
http://training.edutech.org/FLITES
-Gecko

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.