Notoptimal Dev's New YUI-Based Accordion Menu

By YUI TeamJune 7, 2008

Visit Notoptimal Dev's blog post about the new Accordion Menu.

Visit Notoptimal Dev's blog post about the new Accordion Menu.Juan I. Leon at Notoptimal Dev went looking for the perfect Accordion Menu recently, but the search was not a success. The criteria:

  • be lightweight
  • use unobtrusive Javascript techniques (ie not have scattered Javascript all over the markup)
  • use simple CSS to make it look nice
  • needed to support both single and multiple sections opened at a time.

Writes Juan: "My search came up short. Most were overly complicated, or they required libraries other than what I already have running on my sites. Too much bloat. I guess I'd have to write my own. Since I already use the *radical* YUI libraries on my sites, making it YUI-powered was the way to go for me. I set my goal to <100 lines of good OO unobtrusive Javascript. The current version sits at 80 LOC with lots of comments."

You can check out the blog article or jump directly to the example.