JLayout — JavaScript Layout Algorithms
bramstein.com
bramstein.com
http://desandro.com/resources/jquery-masonry/
Basically, jQuery Masonry does intelligent layout, but JLayout is just doing things which can be done with ordinary floats or even tables. It might seem archaic to use tables for layouts such as this but they work even if JavaScript is turned off. And clever use of floats and min-width and max-width can achieve the same effect as well.
Why use JavaScript for something simple that can be done using CSS?
However, if JavaScript is turned off the content will never show, so that is a problem.
You can work around this by using document.write to output the display: none styling.
This layout manager design pattern, while likely always less efficient than native browser mechanisms, is something we'll probably see more of as the browser takes on a greater role as an application host. Without programmatic layout to complement or override the browser's native layout system we won't get the sorts of visual UI building systems and application layouts you're starting to see in frameworks like Cappuccino and Sproutcore.
I was quite hesitant about making the jQuery plugin public because I was fearing reactions such as this. It was meant as a demo, and a nice way to test the layout managers. For a long time I had a message on the jQuery plugin page stating something along the lines of "please, please, consider using CSS before you use this plugin."
The nice thing about programming against a layout manager API is that you can easily write new algorithms while the (DOM) interface remains the same. It would be trivial to write a layout manager that does layout like Masonry. As another example, I'm currently working on a pack layout which can be used to pack small images into a larger one (e.g. CSS sprites,) and a layout manager that implements the CSS box layout module. I was also considering a text layout based on my TeX line breaking work (http://www.bramstein.com/projects/typeset/.)
There were actually a few valid reasons for it back then, but now in the age of layout standards, I don't see it as particularly valuable.