Project Zero

event.stopPropagation();

understanding theory behind: event.preventDefault(); & event.stopPropagation();

$('html').click(function() {
  // Hide the menus if visible.
});

$('#menucontainer').click(function(event){
  event.stopPropagation();
});

 

and when you want to close popup or menu when click out side the area where popup or menu meant to be close what to do !
though i hate theory but follow below link to understand this concept.

https://css-tricks.com/dangers-stopping-event-propagation/

Exit mobile version