I am using jQuery to make a nav slideDown. I want when people click anywhere outside of the nav it slideUp.
The problem is that with my code it slideUp even if I click on the element. I basically want it to slideUp if the user clicks anywhere other than the element which slideDown
//News Drop Down
$(document).ready(function () {
$('li.newsDrop').mouseenter(function () {
$('div.newsadviceDrop').slideDown('medium');
});
});
$('body').click(function() {
$('div.newsadviceDrop').slideUp('slow', function() {
// Animation complete.
});
});
This it wath I would do: