I am using this code:
$(\'body\').click(function() {
$(\'.form_wrapper\').hide();
});
$(\'.form_wrapper\').click(function(event){
event.stopPropagatio
What you can do is bind a click event to the document that will hide the dropdown if something outside the dropdown is clicked, but won't hide it if something inside the dropdown is clicked, so your "show" event (or slidedown or whatever shows the dropdown)
$('.form_wrapper').show(function(){
$(document).bind('click', function (e) {
var clicked = $(e.target);
if (!clicked.parents().hasClass("class-of-dropdown-container")) {
$('.form_wrapper').hide();
}
});
});
Then when hiding it, unbind the click event
$(document).unbind('click');