Re-apply CSS Rules

78 views
Skip to first unread message

Gary

unread,
Jun 14, 2012, 5:43:36 AM6/14/12
to google-we...@googlegroups.com
I am modifying my program to react dynamically to window resizes, and also to make widget sizing more robust.

I have a handler for window resize events; this calls a method in each of my main panels to resize all widgets accordingly. 
Everything is styled through CSS, mostly using percentages to keep things robust. How do I re-apply these CSS rules dynamically?

For example, say the browser is resized from 1920x1080 to 1280x768. Obviously 50% of 1920 is different than 50% of 1280, so I need to re-apply the rules. I cannot find methods to do so.

Thomas Broyer

unread,
Jun 14, 2012, 6:52:24 AM6/14/12
to google-we...@googlegroups.com
CSS is "dynamic", if you specified 50% in CSS, then the browser will take care of it so it's always 50% (of the sizing container).

Gary

unread,
Jun 14, 2012, 9:03:11 AM6/14/12
to google-we...@googlegroups.com
Perhaps I should have tested my CSS first before asking a question. I was just searching the API for methods. Such folly, I do apologise. Thanks anyway.
Reply all
Reply to author
Forward
0 new messages