Here's a solution for NS6 getContentHeight/Width:
get the dimensions of the inner child.

Well, it works for DynLayers with only one child which is all
that's needed for widgets such as Label.

I also found it better on IE5.

Maybe you could use it as a stop-gap (even call it
DynLayer.prototype.getOnlyChildHeight/Width).

Here's what I did with a version of Label I was working on:

Label.prototype.getContentWidth=function(){
        if(is.ie)return this.elm.children[0].clientWidth
        else if(is.ns4)return this.doc.width
        else if(is.ns5)return
parseInt(getComputedStyle(this.elm.firstChild,0).getPropertyValue("width"))
}
Label.prototype.getContentHeight=function(){
        if(is.ie)return this.elm.children[0].clientHeight
        else if(is.ns4)return this.doc.height
        else if(is.ns5)return
parseInt(getComputedStyle(this.elm.firstChild,0).getPropertyValue("height"))
}

You can see it working with pre-precreate version of DynAPI on the demos at:

http://www.montford.f2s.com/dynatrix_docs/tutorial/label.html

Tested on ns4.7, ie5 and ns6 for Windows.

I played briefly on ie4.5 for Mac and it seemed to size OK (although I
noticed that the text selection
didn't turn on and off).

Dicon


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

Reply via email to