Javascript Width Sniffing for Floats

Dunstan uses Javascript to sniff for browser width, take scope of the browser’s window dimensions, check for the amount of screenspace, and determine whether to use a one-column list [with the width of the list items allowed to flow across the width of the parent container] or a two-column list [with the width of the list items fixed to allow the columns to float nicely].

I can think of some interesting tangential applications to that. If you got really anal about this and had a few design elements that you wanted to appear one way in a large browser window but another way in a smaller one, you could certainly do it. Differentiation by browser screenspace may not be easy, but it’s slick.

[Dunstan has since updated the script based upon reader input … and once again for good measure.]