What is it with graphic designers and shadows? Why are they so fond of little boxed and widgets and thingummies that drop they shadows any old way around the page?
That was a rethorical question, so no need to answer. Anyway I’m currently working on a wordpress project that has a lot of little boxes with shadows in the design, and rather than fiddling with nestes divs and images and replacement graphics for browsers that do not support opacity in png images I looked for a javascript solution.
I find that I rely more and more on javascript for layout tasks – I guess many people do by now, especially since most js libraries include now tricks for eye candy (rounded corners etc). Cleaner Markup is one advantage, although one could argue that a dynamically generated mess is a mess nonetheless. But then neither the maintainer of the site nor the validator will ever see the generated markup, so that’s okay.
But the real advantage over a CSS is solution is that you do not have to rely on hacks and workarounds to compensate for different implementations of CSS in the various browsers; instead Javascript calculates the differences programmatically.
I learned once again that this is a superior approach when I tested Erik Rassmussens drop shadow library for my project (built on top of prototype which suits me fine since prototype comes bundled with wordpress anyway) . It worked right out of the box for every browser I tested, including the new Beta for Safari 3 for Windows. Actually in my case I needed a minor change to make it compatible with another script I was running ( the shadower lib clones the element that gets the shadow, so suddenly I had the same id twice), but it still beat the usual trial and error with CSS declarations.
So congratulations to Erik Rasssmussen, not only for a great piece of Javascript but also, and more so, because he just got married and is now on his honeymoon. Herzlichen Glückwunsch!