Bubble menu javascript or playing with YUI’s event delegation

Event delegation refers to the use of a single event listener on a parent object to listen for events happening on its children (or deeper descendants). Event delegation allows developers to be sparse in their application of event listeners while still reacting to events as they happen on highly specific targets. This proves to be … Continue reading Bubble menu javascript or playing with YUI’s event delegation

Expanding/collapsing javascript menu

In this post I’ll show you how to create an expanding/collapsing menu like Slashdot left menu used to be, using the YUI library and Dav GlassYUI effects widget. The HTML markup for our menu is : <div id=”menu”> <h1 id=”menu-title”>Menu</h1> <div id=”menu-links”> <ul> <li>Home</li> <li>About</li> <li>CSS</li> </ul> </div> </div> We use 2 div tags, one for holding the menu itself and the … Continue reading Expanding/collapsing javascript menu