I have seen a lot of overly complex solutions for this simple problem and none of them have been valid solutions, here is a snippet that accomplishes it in an unambiguous manner.
$('#el').dialog({
open: function(e){
var self = this;
$('.ui-widget-overlay').bind('click', function(){
$(self).dialog('close');
});
},
close: function(){
$('.ui-widget-overlay').unbind('click');
}
});






Leave Your Response