Taco Fleur - Pacific Fox wrote:
I am looking for some ideas on how to create a JavaScript/CSS fly-out menu,
the dreaded day has come that a client finally insisted on using one!
...
var menu = new Object();
menu[ "about_bdsrecruit" ] = new Object();
Yikes! Don't generate a menu like that, it's a waste of time.
Markup:
<ul>
<li><a href="#">Item 1</a></li>
<li>Item 2
<ul>
<li>Submenu item 1</li>
<li>Submenu item 2</li>
<li>Submenu item 3</li>
</ul>
</li>
<li>Item 3</li>
</ul>
Make them all links if you like, I just omitted the a elements for
simplicity.
CSS:
li ul { display: none; }
li:hover ul { display: block; }
/* Plus whatever styles you want to make it look good and layout
correctly. */
JS:
Attach mouseover and mouseout event listeners to the li elements to show
and hide the sub menus.
Google for "Pure CSS Menus", "Suckerfish Dropdowns" "CSS/JS menus" or
similar search terms.
--
Lachlan Hunt
http://lachy.id.au/
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************