Comments on: Hide popup when clicking outside http://www.antimath.info/jquery/hide-popup-when-clicking-outside/ thoughts: simple; Tue, 21 Aug 2018 11:58:39 +0000 hourly 1 https://wordpress.org/?v=4.9.8 By: Mihai http://www.antimath.info/jquery/hide-popup-when-clicking-outside/#comment-314588 Sat, 30 Jun 2018 16:29:13 +0000 http://www.antimath.info/?p=433#comment-314588 First, the “function (e) ” should be “function (event) “;
Second, this will hide your .modal, when .modal_wrapper is clicked, and I presume that .modal_wrapper is full screen width and height and that .modal is centred inside.
This will work in this particular case.

How about if instead of the modal, which has a wrapper that covers the entire screen so anything else in the page is basically un-clickable, you want to hide some sort of dropdown or tooltip?

Thanks for the comment.

]]>
By: Dastan http://www.antimath.info/jquery/hide-popup-when-clicking-outside/#comment-314569 Sat, 09 Jun 2018 03:42:11 +0000 http://www.antimath.info/?p=433#comment-314569 $(document).on(‘click touch’, function (e) {
if ($(event.target).hasClass(‘modal_wrapper’)) {
$(‘.modal’).fadeOut();
}
});

]]>
By: shailesh http://www.antimath.info/jquery/hide-popup-when-clicking-outside/#comment-314019 Tue, 05 Sep 2017 08:31:31 +0000 http://www.antimath.info/?p=433#comment-314019 it’s working fine.

]]>
By: Mohammad Anzar http://www.antimath.info/jquery/hide-popup-when-clicking-outside/#comment-313904 Fri, 25 Aug 2017 10:00:45 +0000 http://www.antimath.info/?p=433#comment-313904 Thank you so much. It worked for me

]]>