tags:

views:

174

answers:

1

I have a YUI menu top bar navigation menu based from this example.

I'd like to be able to insert items to it that serve as captions and not menu items. For instance I may have a list of products in different categories, and I want a category heading for each. I don't want submenus - I want headings WITHIN the menu.

I was hoping it was as simple as doing this :

 <li class="menuHeading">Heading</li>

(and obviously defining the menuHeading style).

This actually works - insomuch as the item appears in the menu in the correct position. But it behaves as a menu item (highlights in blue when I rollover it). I inspected the DOM in Chrome and it appears that the YUI menu javascript is actually adding the following class 'yuimenuitem' and giving it a generated ID.

Is there an 'official' way to do what I want or do I have to resort to some hack, I'm thinking just changing the menuHeading class to have a white background when I hover over it, but I'd rather not do that if I don't have to.

A: 

YUI Menu has support for headings built in - they're called group titles. There are two YUI Menu examples that illustrate how to title groups:

http://developer.yahoo.com/yui/examples/menu/example05.html http://developer.yahoo.com/yui/examples/menu/example06.html

thanks. sorry missed that somehow
Simon_Weaver