Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery modal if clicked outside

$('body').click(function (event) 
{
   if(!$(event.target).closest('#openModal').length && !$(event.target).is('#openModal')) {
     $(".modalDialog").hide();
   }     
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #modal #clicked
ADD COMMENT
Topic
Name
2+2 =