I'm looking for some assistance in modifying the code so that the dropdown menu not only hides on click, but also hides on mouseout and/or when another top-level menu button is hovered over.
$(document).ready(function () {
$("li").click(function () {
$('li > ul').not($(this).children("ul").toggle()).hide();
});
});
I am still learning jQuery/script coding and trying to improve my skills.
Just a heads up - I am using divs as part of the structure of the dropdown, so keep that in mind if replacing "ul" with a div.
Credit for the initial code goes to Pramod Sankar L (user PSL).
Any help or pointers would be greatly appreciated!