[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mozilla-layout
Subject:    Re: Javascript in layers
From:       "Robert E. Boughner" <reboughner () widomaker ! com>
Date:       1999-09-27 0:39:07
[Download RAW message or body]

Isaac Hall wrote:

> I've got a hair-pulling problem. I've got some mouseover javascript code
> that
> switches images, pretty simple. But when the images are in layers positioned
> "absolute", the code works up to (but not including) the line where the
> images
> should be switched. The code works great in IE5, but it's a problem in
> Netscape Communicator 4.61. Does anyone have any workarounds?
>
> Style:
> #catagories {position: absolute; left: 0px; top: 190px; }
>
> Javascript:
> function msover(num) {
>     if (document.images) {
>         document.images["button" + num].src = over[num].src;
>     }
> }
>
> Thanks,
> Isaac Hall

Its a matter of getting the correct reference to the image.  If the images are
in the layer with the ID = catagories then you reference them as follows:
document.layers['catagories'].document.images["button"+num].src = over[num].src
or if you prefer
document.catagories.document.images["button"+num].src = over[num].src

Robert E. Boughner

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic