Log in

View Full Version : Sub menu problem



dustnbones
11-15-2010, 09:02 PM
For some reason, I can't figure out, I can't add a sub menu. I'm using
jQuery Multi Level CSS Menu #2.
In the website link below is a menu link 'Training Courses'. Below that is drop down link 'Geometrical Tolerancing'. I want to create a sub menu from that link but every time I try it goes all wrong. Can anyone explain how I can do this please?

http://www.sunridgegraphics.co.uk/mac

Beverleyh
11-16-2010, 08:47 AM
I think you need to revisit the script page and look at the example code again (you didnt provide a link but it appears to be this one: http://www.dynamicdrive.com/style/csslibrary/item/jquery_multi_level_css_menu_2/ )

The example shows one lowest level list with nested lists for sub-menus.
Yours shows many lowest level lists each with their own scrambled nested lists for sub-menus. You closing tags are all over the place so that why you're having problems.

The colours might help you understand the nesting method a little better;


<ul>
<li><a href="http://www.dynamicdrive.com">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Folder 1</a>
<ul>
<li><a href="#">Sub Item 1.1</a></li>
<li><a href="#">Sub Item 1.2</a></li>
<li><a href="#">Sub Item 1.3</a></li>
<li><a href="#">Sub Item 1.4</a></li>
</ul>
</li>
<li><a href="#">Item 3</a></li>
<li><a href="#">Folder 2</a>
<ul>
<li><a href="#">Sub Item 2.1</a></li>
<li><a href="#">Folder 2.1</a>
<ul>
<li><a href="#">Sub Item 2.1.1</a></li>
<li><a href="#">Sub Item 2.1.2</a></li>
<li><a href="#">Folder 3.1.1</a>
<ul>
<li><a href="#">Sub Item 3.1.1.1</a></li>
<li><a href="#">Sub Item 3.1.1.2</a></li>
<li><a href="#">Sub Item 3.1.1.3</a></li>
<li><a href="#">Sub Item 3.1.1.4</a></li>
<li><a href="#">Sub Item 3.1.1.5</a></li>
</ul>
</li>
<li><a href="#">Sub Item 2.1.4</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="http://www.dynamicdrive.com/style/">Item 4</a></li>
</ul>

So, its one base-level list (black).
The first level nested lists (purple and blue) are the first level sub-menus.
The blue first level nested list then contains another red nested list, which in turn contains a further green nested list, forming a 2nd sub-menu and 3rd sub-menu respectively.

This is the format you should use when you code your menu.