jQWidgets Forums
jQuery UI Widgets › Forums › Dialogs and Notifications › Window › Hide popup if click detected elsewhere › Reply To: Hide popup if click detected elsewhere
Hello arkgroup,
You can also use event.stopPropagation();
or event.cancelBubble = true;
to stop the click event from bubbling to parent elements. Here are the examples:
1) event.stopPropagation
$(document).on("click", function (event) {//second way
event.stopPropagation();
$('#jqxwindow').jqxWindow('close');
});
2) event.cancelBubble
$(document).on("click", function () {
event.cancelBubble = true;
$('#jqxwindow').jqxWindow('close');
});
Best Regards,
Nadezhda
jQWidgets team
http://www.jqwidgets.com/