Question

I am making a slider based component in GWT.

Parent : width = 100%
.-------------------------------------------------.
| .---------------------------------------------. |
| |     Child : width = X                       | |
| '---------------------------------------------' |
'-------------------------------------------------'

where X = (parent's width in px) - (some calculations based on runtime);

My code says:

int providedWidth = parentContainer.getOffsetWidth();

In Firefox, I get the width correctly as (say) 345px But in IE6, it constantly returns the width as 0 no matter what size it is.

From GWT perspective, Parent is an AbsolutePanel placed within a DockPanel (super parent), Child is a a HorizontalPanel.

I haven't placed code here for brevity, is there any other way to get the width or am I doing something wrong ?

Was it helpful?

Solution

Just a wild guess, but maybe the element needs "layout" in IE6? Can you give it style='zoom:1'?

OTHER TIPS

In IE you sometimes have to get the size information in a DeferredCommand because IE only does the layout after the event thread is done.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top