I'm using the following to initially hide the div on pageload and then toggle the hide show states.
$(function() {
$('#playlist_wrapper').hide();
$('#toggle_playlist').click(function() {
$('#playlist_wrapper').slideToggle(400);
return false;
});
});
I'd like to make it possible to also hide the div (when visible) by clicking anywhere else on the page outside the #playlist_wrapper div.
I know it's done with 'mouseleave' in Jquery or 'mouseout' in plain JS but I just don't know how to implement it here.
Any help would be appreciated.
Cheers!