hiding DIV when clicking away from it
You should use stopPropagation:
$(body).click(function(e)
{
$('#optionsMenu').slideUp('fast');
});
$('#optionsMenu').click(function(e)
{
e.stopPropagation();
});
You could use on()
, perhaps:
$('body').on('click', function(e){
if ($(e.target).not('#optionsMenu')){
$('#optionsMenu').slideUp('fast');
}
});
The above not yet tested, but should, I think work.