...

View Full Version : inside Div tag, can't use mouseover on image in Netscape..why?



BrightNail
09-29-2002, 10:54 PM
hey all..this is what i have.

<div style="position:absolute; left:613; top:291">
<a href="aboutrob.html" onmouseover='rollOn("aboutrob");' onmouseout='clearprev("aboutrob");' onclick='onDown("favorite");'><img src="images/nav_aboutrob_off.gif" alt="Learn About Rob" width="109" height="209" border="0" name="aboutrob"></a>
</div>

in IE, this is fine...in Netscape,,,it generates a JS error ..with

document[imgName] has no properties.

how come?....anyway around this?

adios
09-29-2002, 11:21 PM
<script type="text/javascript" language="javascript">

function NS_flatten_images() {
if (!document.layers) return;
for (var i,img,l=0; l<document.layers.length; ++l) {
i = 0;
while (img = document.layers[l].document.images[i++])
if (img.name) document[img.name] = document.images[img.name] = img;
}
}

onload = NS_flatten_images;

</script>

(OK if nested no more than one Layer deep..)

BrightNail
10-01-2002, 10:56 PM
cool..thanks,

I found a workaround..which is pretty much what you wrote down....thanks..appreciate it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum