Use
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
void execute() {
int topOfSpace = topSection.getAbsoluteBottom();
int botOfSpace = botSection.getAbsoluteTop();
int middleHeight = middleSection.getClientHeight();
int topOfMiddle = topOfSpace + (botOfSpace - topOfSpace -
middleHeight)/2;
DOM.setStyleAttribute(DOM.getElementById("midSection"), "top",
topOfBoard + "px");
}
});
The code inside the command is delayed slightly, so it will be executed
AFTER all your other JS code is done (so its kind of async) and the browser
had some time to do its layout computations.
GWT's HeaderPanel widget (header + center + footer) does the same to
recalculate the height of the center area. Maybe you can actually use it?
-- J.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.