Stop using stopPropagation and manually check if the click was inside #menu
or not :
$('#menu').on('click', function() {
$('.dropdownContain').toggle();
});
$(document).on('click', function(e) {
if (! $(e.target).is('#menu') || $(e.target).closest('#menu').length )
$('.dropdownContain').hide();
});