From: <ice...@ve...> - 2000-12-05 09:40:48
|
OK, Bill, thanks for your aid, but other things more :-) You are right as far as that acceding to the wide one by means of the function getWidth() more is OO than directly by means of w. But as far as the one of which this.css.width is single for ie or ns5 I do not agree. Watching the following code that is called during the creation of the layer we found that: DynLayer.prototype.assignElement=function(elm) { this.elm=elm if (is.ns4) this.css=this.elm this.doc=this.elm.document this.doc.lyrobj=this } else if (is.ie || is.ns5) { this.css=this.elm.style this.doc=this.parent.doc } this.elm.lyrobj=this this.created=true } this.css directly points in the style of the layer independientemete of the browser, in addition use ie. Although I repeat that you are right and the correct way to obtain the wide of the layer is by means of the method getWidth(). bye. ----- Original Message ----- From: "Bill Wheaton" <bil...@us...> To: <dyn...@li...> Sent: Monday, December 04, 2000 8:29 PM Subject: Re: [[Dynapi-Dev] Re: Layer Aling] > Perhaps, (and I am not sure) it is because this.css.width is only for ie and > ns5 and you might be using netscape 4.7???? > > I found this in DynLayer's setSize method. Otherwise it sets the clip width > and height. > if (is.ie || is.ns5) { > this.css.width=w > this.css.height=h > } > For cross browser compatability use the '.getWidth()' method or, the '.w' > property (not .css.width) > > But this.w accesses the width directly, which is really a no-no in OO. > getWidth() is better, because someone may change the '.w' property to > '.widthofmyfunkylayerthingamajig' someday. If you use this.getWidth() it > should still work even then, assuming they did it right. > Regards > -bw |