Thursday, September 23, 2010

GetOffsetWidth and css

(I'm using GWT 2.1.0M3)

I'm putting an element in an AbsolutePanel, which has some css classes
(injected classes). One of the things these classes change is the
width and height of the element.

The code needs to know the element's width and height, and so it tries
to get them with the getOffsetWidth and getOffsetHeight methods.
However these give the width and height of the element before the css
adjustments, not the real on-screen ones, and as a result all sorts of
things get misplaced.

Is there a way to get the "real" width and height of an element,
whether or not these have been adjusted with css ?

Cheers,

Christophe

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment