I\'d like to be able to detect the (x) close button of a jQuery UI Dialogue being clicked, but I don\'t want to use the dialogclose
/ dialogbeforeclose
you could do exactly what JAAulde suggested, or avoiding tracking binding and use the create
event:
$(document).ready(function() {
$('#dialog').dialog({
create: function() {
$(this).closest('div.ui-dialog')
.find('.ui-dialog-titlebar-close')
.click(function(e) {
alert('hi');
e.preventDefault();
});
}
});
});