To view the live demonstration, simply click here. I have an issue with my drop down menu where it is hidden upon first click. Additionally, I would like the drop down menu to disappear when clicked anywhere outside of its current display. How can I accomplish this?
Below is the jQuery code I am using:
$(document).ready(function () {
$('#jsddm > li').click(function(e){
e.preventDefault();
$(this).find('ul').eq(0).css('visibility', 'visible').slideToggle();
});
});
I have noticed that if .css('visibility', 'visible')
is removed, the functionality of the drop down menu ceases to work.