From: Cameron H. <ca...@bi...> - 2001-01-23 18:33:17
|
> The problem with getContentW/H is affecting almost all of the other > widgets in NS 6, especially the ones that use the label since it > relies on those methods. So, we should fix these methods before > making changes to the widgets. LoadPanel doesn't use getContentHeight/getContentWidth for Netscape 4, so I don't see a problem with not using them for Netscape 6. I've been having a quick look at label.js, i managed to get it working in netscape 6, it's pretty rough but it does the trick. the main purpose of me doing this was as an investigation into getting getContentHeight and getContentWidth working. The first thing is getContentWidth and getContentHeight should probably return offsetWidth and offsetHeight. There unfortunately isn't a scrollHeight or scrollWidth. The second thing I found was the clip seemed to be causing problems in ns6. when setWidth or setHeight is called it also sets the clip, but if you call setWidth and no height has been set for the DynLayer then the clip height is set to 0. A 0 value should actually auto size to the size of the layer according to the w3c css2 spec (i think this is the case, try and make sense of http://www.w3.org/TR/REC-CSS2/visufx.html#clipping). but in ns6 it doesn't work. so instead of setting a clip when i set the size i set the overflow style of the dynlayer div to hidden. perhaps this will cause problems elsewhere, this isn't really supposed to be a fix, it's just research... none of this helped with the list stuff, i haven't had a chance to look at that. cheers, cameron. > -- > // Robert Rainwater > > On 1/23/2001, 4:53:11 AM EST, Cameron wrote about "[Dynapi-Dev] > Width/Height and LoadPanel in NS6": > > > 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: dyn...@li... > >> [mailto:dyn...@li...]On Behalf Of > >> ni...@pr... > >> Sent: 22 January 2001 23:37 > >> To: dyn...@li... > >> 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 > >> > Dyn...@li... > >> > http://lists.sourceforge.net/lists/listinfo/dynapi-dev > >> > >> > >> > >> _______________________________________________ > >> Dynapi-Dev mailing list > >> Dyn...@li... > >> http://lists.sourceforge.net/lists/listinfo/dynapi-dev > > > > _______________________________________________ > > Dynapi-Dev mailing list > > Dyn...@li... > > http://lists.sourceforge.net/lists/listinfo/dynapi-dev > > > ---------------------- > DynAPI Snapshots: http://dynapi.sourceforge.net/snapshot/ > DynAPI Homepage: http://dynapi.sourceforge.net/ > > > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-dev |