I’m about to make a simple drop down menu with some jQuery.
Here is the blueprint of my menu:
This is my jQuery:
$( "a.drop_down" ).click(function () {
if ( $(this).siblings("ul").is( ":hidden" ) ) {
$(this).siblings("ul").slideToggle('slow','easeOutBounce');
}
else {
$(this).siblings("ul").hide();
}
});
And here is the thing what I’m trying to achieve:
I only want one drop down menu to be opened at a time, any menu click (sub-menus included) should close the already opened drop down menu. Of course, if I click another dropdown menu, not only should it close the opened menu, but drop down as well.
I would really appreciate any suggestion.