I have the following HTML code:
Menu
submenu1
-
Create anchors at Menu and Menu2
and script:
$(".dim > a").click( function ( e ){
e.preventDefault() // prevent default action - hash doesn't appear in url
$( this ).parent().find( "div" ).toggleClass( "hidden" );
});
When click anyone of link submenu belonging to it will will appear or disappear
Live demo: http://jsfiddle.net/ZxwpJ/