I have designed a vertical menu with multiple sub menus. Each menu contains at least 3 sub menus, and the sub menus are set to open only when their parent menu is clicked. (I require jQuery
support for this menu) However, since I do not use jQuery
on any other pages, I decided not to link jQuery
for this particular menu. Without jQuery
, the menu appears like this: withoutjQuery
**If a coder can make this menu work without jQuery
, you are welcome to do so. Alternatively, suggestions on how to achieve this using just CSS
are also appreciated.
Here is the jsfiddle that utilizes jQuery
. Can someone modify it to work without jQuery
?
Function
$(function () {
$('li ul').hide();
$("#leftmenuidfrmslt li").click(function(e) {
var submenu = $(this).children("ul");
if (!$(submenu).is(":visible")) {
$('li ul').slideUp("fast");
submenu.slideDown("fast");
} else {
submenu.slideUp("fast");
}
});
});