Hey, look at this clean and clever use of a few lines of javascript, with some
CSS tricks, to produce a fast
DHTML dropdown menu. (You
may have seen it before, if you're interested in DHTML programming -- it's not
new news.) Well, it's much better than the thousand-line bloated and
cargo-cultified javascript code that we can see floating around, used to display
disgraceful, slow and over-heavy menus.
In fact, javascript is still in a
situation that's not very different from the pre-CPAN Perl 4 era. Lots
of bad code everywhere, no community-endorsed comprehensive archive,
programming based on frantic cut-n-paste, poor quality shareware, poor docs.
But it's actually becoming possible to do Real Work with it.
SVG (Score:3, Informative)
That's one thing I love with SVG: you get real EcmaScript (almost always Mozilla's engine) with a real DOM and you can do really elegant things in tiny bits of code. When you can do that in XHTML too it rocks, I have a ten liner that can do notebook style tabbing in XHTML nicely and swiftly -- it was such a pleasure just throwing it together in ten seconds :) I really hope that ecmascript takes off to become something usable, which in itself only requires that we can stop caring about compatibility problems and some user education.
-- Robin Berjon [berjon.com]
Reply to This
Unobtrusive DHTML (Score:2, Informative)
This is my favourite way of using "lists", css and javascript to create dynamic menus.
It's called unobtrisuve because it barely adds any addtitional markup to your document, which is the whole point, plus it degrades very nicely if your browser doesn't support all the fancy styling of javascript technique.
This approach is less hassle to maintain: only the top level list needs a class and the javascript walks the DOM tree and adds the behaviours and styles rather have to class and sub class every tag
-- tex