$(document).ready( function(){
$('#trigger').click( function(event){
event.stopPropagation();
$('#drop').toggle();
});
// this is the most important part
$(document).click( function(){
$('#drop').hide();
// where #drop is the entire collapsed menu
});