A layer's content size can only be retrieved after the layer has been
added to the document or a layer that has been added to the document. This
is because the browser does not render/draw the DynLAyer's content until a
real HTML layer is created, and obviously there is no way to ask for the
size of the content until the browser has drawn it and knows how big it
is.
Tom Wilcoxen wrote:
> Thanks to everybody for the great answers. I've solved that bit using
> basically the solution below, but now have a related question. I'm
> trying to get the height of these new layers, but am getting 'null' or
> '0' returned.
>
> I've tried using lyrref[i].getContentHeight() and just lyrref[i].h and
> neither one returns the height. I need to stack the layers vertically
> and can't seem to. (I can make a nice pile though. :P )
>
> Is there some trick? I'm (obviously) new to DynAPI and very excited
> about it. Thanks for making a great dhtml interface.
>
> Thanks!
> Tom
>
> --- Robert Rainwater <[EMAIL PROTECTED]> wrote:
> >
> > If you want to have references to the elements just create an array
> > like:
> >
> > var lyrref = new Array();
> > for (var i=0; i<o.items.length; i=i+2){
> > lyrref[i] = o.menuItems.addChild( new DynLayer() );
> > linkItem = "<a href='" + o.items[i] + "'>" + o.items[i+1] +
> > "</a>";
> > lyrref[i].setHTML(linkItem);
> > lyrref[i].setVisible(true);
> > }
> > }
> >
> > --
> > Robert Rainwater
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.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