Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    349
    Thanks
    2
    Thanked 0 Times in 0 Posts

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

    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?

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    <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..)

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    349
    Thanks
    2
    Thanked 0 Times in 0 Posts
    cool..thanks,

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •