Hi,
I tried your example, but it seems to work fine on ns4.08 and ns4.7.
the popup is only visible when mouseover the links.

I have noticed in the past that setting z-index values in NS4 can be
erratic, sometimes you have to set the value for both layers, (the one
coming up, and the one staying the same) and sometimes you do setZIndex(+1),
or -1.

To economize your code a little, you could simply move the layers off
screen, instead of hiding them.

That would be this for layer a:

 aLayer=new DynLayer(null,-200,180,163,150,'',false);
 aLayer.setHTML('blah blah');
 this.document.addChild(aLayer)

So the layer starts off-screen, and the link:

<a href="#" onmouseover="aLayer.moveTo(200,80); "
onmouseout="aLayer.moveTo(-200); ">A layer appears here</a>

If you have a lot of these links you could also just use one layer, and set
the new html content before moving into view.


Cheers,
Richard Bennett

[EMAIL PROTECTED]
www.richardinfo.com
(Everything running on, and ported to DynAPI2.51)
visit the DynAPI homepage (and FAQ) ::
http://dynapi.sourceforge.net/dynapi/index.php?menu=1
Browse (and search) the mailinglist here:
http://www.mail-archive.com/index.php3?hunt=dynapi


----- Original Message -----
From: "Kit Cheong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 30, 2001 12:21 PM
Subject: [Dynapi-Help] setting the visibility of layers


> hi,
>
> This is my first time using dynapi and i gotta say it
> makes it much
>
> easier to write cross-browser code.
>
> Anyway, i got a problem. i have a couple of layers and
> have put html
>
> in them using setHTML. these layers are defined to be
> hidden when i
>
> first create them. my problem lies with netscape 4 and
> above (till
>
> before 6). in ie and ns6, the code works fine.
>
> well, what happens is that on ns4 when the layers
> load, a portion of
>
> the layer can be seen displaying on the top of the
> page. and stays on
>
> top of the background text until you move to another
> browser and then
>
> it disappears.
>
> wherever there's an image<img> in the code, u can just
> replace it with anything to test it out.
>
> here's my code:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
> Transitional//EN">
>
> <html>
> <head>
> <title>Untitled</title>
> </head>
>
> <body>
>
> <script src="../../dynapi/src/dynapi.js"></script>
> <script>
> DynAPI.setLibraryPath('../../dynapi/src/lib')
> DynAPI.include('dynapi.api.browser.js')
> DynAPI.include('dynapi.api.dynlayer.js')
> DynAPI.include('dynapi.api.dyndocument.js')
> DynAPI.include('dynapi.event.*')
>
> DynAPI.onLoad = function() {
>
>     aLayer=new DynLayer
> (null,105,180,163,150,'',false);
> aLayer.setZIndex(56);
> bLayer=new DynLayer (null,105,240,163,156,'',false);
> bLayer.setZIndex(78);
>
> aLayer.setHTML('<table width="160" border="0"
> cellspacing="0"
>
> cellpadding="1" align="left"><tr><td>layer a text goes
> here layer a
>
> text goes here<br><img src="Weird.jpg" width="150"
> height="120"
>
> border="0" alt=""><br>layer a text goes here layer a
> text goes here
>
> layer a text goes here</td></tr></table>');
>
> bLayer.setHTML('<table width="160" border="0"
> cellspacing="0"
>
> cellpadding="1" align="left"><tr><td>layer b text goes
> here layer b
>
> text goes here<br><img src="Weird.jpg" width="150"
> height="120"
>
> border="0" alt=""><br>layer b text goes here layer b
> text goes here
>
> layer b text goes here</td></tr></table>');
>
> this.document.addChild(aLayer)
> this.document.addChild(bLayer)
> }
> </script>
>
> some text here. this is only a test. some text here.
> this is only a
>
> test. some text here. this is only a test. some text
> here. this is
>
> only a test. some text here. this is only a test.
> some text here.
>
> this is only a test.some text here. <br><img
> src="Weird1.jpg"
>
> width="220" height="250" border="0" alt=""><br>this is
> only a test.
>
> some text here. this is only a test. some text here.
> this is only a
>
> test.some text here. this is only a test.some text
> here. this is only
>
> a test.some text here. this is only a test.some text
> here. this is
>
> only a test.some text here. this is only a test.some
> text here. this
>
> is only a test.some text here. this is only a
> test.some text here.
>
> this is only a test.some text here. this is only a
> test.some text
>
> here. this is only a test.some text here. this is only
> a test.some
>
> text here. this is only a test.some text here. this is
> only a
>
> test.some text here. this is only a test.some text
> here. this is only
>
> a test.some text here. this is only a test.some text
> here. this is
>
> only a test.some text here. this is only a test.some
> text here. this
>
> is only a test.some text here. this is only a
> test.some text here.
>
> this is only a test.
>
> <br><br><a href="#"
> onmouseover="aLayer.moveTo(200,80);
>
> aLayer.setVisible(true);"
> onmouseout="aLayer.setVisible(false);">A
>
> layer appears here</a><br><br>
> <a href="#" onmouseover="bLayer.moveTo(200,240);
>
> bLayer.setVisible(true);"
> onmouseout="bLayer.setVisible(false);">B
>
> layer appears here</a>
> </body>
> </html>
>
> thanks.
> :)
> kit.
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-help
>


_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to