I have done something similar. However I don't think that offsetWidth and
offsetHeight do quite do the right thing, what we need is a Netscape 6
equivalent to IE's scrollWidth and scrollHeight.

For those who are interested, Mozilla has offsetHeight and offsetWidth (see
http://www.mozilla.org/status/2000-08-04.html), but not scrollHeight and
scrollWidth. See http://msdn.microsoft.com/workshop/author/om/measuring.asp
for an explanation of the difference. The problem I have with offsetHeight
in LoadPanel is because I always set the height of the LoadPanel, the height
I have set is returned by offsetHeight, not the true height of the content.
However when I load a new page in LoadPanel if I write the HTML into a new
child DynLayer that has no dimensions set on it, then offsetHeight returns
the correct contentHeight of the new Layer.

There isn't a lot of documentation on these measurements either, because
they aren't part of the DOM as far as I can tell.

Cheers

Cameron.

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> [EMAIL PROTECTED]
> Sent: 22 January 2001 23:37
> To: [EMAIL PROTECTED]
> Subject: Re: [Dynapi-Dev] Width/Height
>
>
> this is what I use :
> DynLayer.prototype.getContentWidth=function() {
>     if (!this.created) return 0
>     else {
>         if (is.ns4) return this.doc.width
>         else if (is.ns5) return parseInt(this.elm.offsetWidth)
>               else return parseInt(this.elm.scrollWidth)
>     }
> }
> DynLayer.prototype.getContentHeight=function() {
>     if (!this.created) return 0
>     else {
>         if (is.ns4) return this.doc.height
>         else if (is.ns5) return parseInt(this.elm.offsetHeight)
>         else return parseInt(this.elm.scrollHeight)
>     }
> }
>
> > and none seem to work.  This is the source of several problems
> with the DynAPI in NS 6.
>
> this is true if you try to getContentWidth and Height
> before the layer it's actually shown in the page
> coz the browser itself takes time to get the info aboutthe layer
> ,(sorry but my english sucks)
>
> I've tested in many ways and like i said before in the
> widget-list the only way is to put a setTimeout for ns6
> but that cause other problem when u have a lot of nested layers
> or complex widget
>
> once the layer it's on the page u can
> alert(myLayer.getContentWidth()) and it will work
>
> ciao
> Y
> >
> > --
> > // Robert Rainwater
> > ----------------------
> > DynAPI Snapshots: http://dynapi.sourceforge.net/snapshot/
> > DynAPI Homepage: http://dynapi.sourceforge.net/
> >
> >
> >
> > _______________________________________________
> > Dynapi-Dev mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/dynapi-dev
>
>
>
> _______________________________________________
> Dynapi-Dev mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-dev


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

Reply via email to