John Lindal’s Blog
The Joy of Hacking
September 3, 2009 on 8:16 pm | In Programming | No CommentsI’ve spent quite a bit of time over the past couple of years writing layout managers in JavaScript. If you happen to have access to Yahoo! APT, then every time you resize your browser window and everything expands or shrinks to fit the available space — that’s mah baby. I sometimes joke that the layout manager is going to put my daughter through college, because it’s on version 3 already and my next project is version 3a. But I digress…
All sizes in version 3 are percentages. This keeps the math and the configuration simple. (Version 2 let you use any unit, %/em/px, and it was a bear.) Recently, somebody asked if it would be possible to mix in fixed size elements. After thinking about it, I realized that I could treat fixed size elements the same way that I already handle collapsed elements, since collapsed elements are a (small) fixed size. A long day and a few judiciously placed statements later, and it works!
And the really cool part is that instead of making a complete mess of the configuration by introducing units, I simply added a keep your grubby paws off this element
flag. The element’s size can then be set via CSS, the good old-fashioned way
No Comments yet »
RSS feed for comments on this post.
Leave a comment
You must be logged in to post a comment.
Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^