PDA

View Full Version : Best way to have Container resize based on browser resize



Pandaman
30 Jul 2009, 2:28 PM
I want to be able to have my container resize width based on resizing the browser's width. However, I would like the ability to scroll vertically if there is material out of vertical viewing area.

So far I've tried using a Viewport, but it seems that it doesn't allow scrolling vertically. If this is actually true, what other options do I have? I have also tried adding a listener to Window (com.google.gwt.user.client.Window) that calls setWidth on a LayoutContainer, but resizing seems a bit choppy (especially in ie6). Maybe because it is firing many events and trying to resize the container many times as I resize the browser.

deanna
30 Jul 2009, 2:30 PM
Could just css handle that. I don't know your specific layout, but many times css can handle the resize better than a script.

Pandaman
30 Jul 2009, 2:54 PM
Good idea!

I've been stubborn as a mule to keep resizing in java to play it safe for browser independence... but after playing around with my site using firebug, it seems that CSS can pretty much handle resizing for all browsers I am concerned with.

Thank you!

Arno.Nyhm
3 Aug 2009, 3:17 AM
it would be nice if you show your css changes in some code snippets how you resolve your problem.