【问题标题】:JQueryUI dialog hide option prevents close event from firingJQueryUI 对话框隐藏选项可防止关闭事件触发
【发布时间】:2012-11-20 17:26:57
【问题描述】:

当使用添加了 hide 选项的 JQueryUI 对话框时,close 事件永远不会触发。请参阅下面的小提琴以两种方式进行复制。
有没有我不知道的解决方法?我尝试重新排序它们,但没有奏效。有什么想法吗?

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');

【问题讨论】:

    标签: jquery-ui-dialog


    【解决方案1】:

    您在小提琴中使用的是 jQuery UI 1.7.2。如果您将其替换为最新版本(1.9.1 - //ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js),那么您的代码将按预期工作。我不知道这些版本之间到底发生了什么变化,但你去吧

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-10
      • 1970-01-01
      • 2018-08-08
      • 2014-06-17
      • 1970-01-01
      • 1970-01-01
      • 2015-02-11
      • 1970-01-01
      相关资源
      最近更新 更多