I'm trying to give the user a modal window when the leave the browser, and clicked on the taskbar or something.
The following code works in FF, Chrome, IE9, etc. But it does NOT work in IE8. What am I missing here?
$(document).ready(function () {
$(window).focus(function () {
$("#dialog-message").dialog("close");
})
.blur(function () {
var options = {};
$("#dialog-message").dialog({
modal: true,
position: 'center',
resizable: false,
closeOnEscape: true,
open: function (event, ui) {
$(".ui-dialog-titlebar-close", ui.dialog).hide();
},
show: "explode",
hide: "explode"
});
}).trigger('focus');
});