slavapascaru
5/8/2018 - 8:22 PM

Close dropdowns by clicking outside of them with jQuery

 $(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
});