当使用添加了隐藏选项的 JQueryUI 对话框时,关闭事件永远不会触发。请参阅下面的小提琴以两种方式进行复制。
有没有我不知道的解决方法?我尝试重新排序它们,但没有奏效。有任何想法吗?
http://jsfiddle.net/johntrepreneur/f4Ytr/3/
JAVASCRIPT(用于小提琴):
var $dialog = $('<div></div>').html('Using the hide dialog option ' +
'prevents the close event from firing. Clicking close does ' +
'nothing. Try commenting out the javascript line with the ' +
'hide effect to see the alert show up after clicking close.'
).dialog({
close: function () { alert('this will never show if hide option is active'); },
//hide: { effect: 'drop', direction: 'up' } //comment out to see alert show up
});
$dialog.dialog('open');