0

我正在使用简单的模态窗口在模态窗口弹出窗口上显示动态内容(表格)。当我只是在模式窗口中显示数据时,关闭事件工作正常。

但是,如果我在关闭 jquery 弹出对话框后在简单模式窗口上显示另一个 jquery 对话框弹出窗口,则我的简单模式窗口弹出 onClose 事件不起作用。

   // Base Modal popup
   $('#simple').modal({
       onShow: function() { 
           alert("activated"); 
       },
       onClose: function() {
           alert("deactivated");
           $.modal.close(); 
       }
   });

   // Jquery popup
   $('#kick').dialog({
       //ajax calls to show data  
   });

即使我正在使用$.modal.close(); 请关闭事件第二次也无法正常工作...请帮助我...我已经花了一天时间...

4

3 回答 3

0

只是一些想法,因为我在这台计算机上没有 VS2010 并且无法确认实际语法:(

$('#simple').close();
$(this).modal.close();
this.close();

不过,这就是我们关闭对话框的方式:

$(this).dialog("close"); 

所以也许这会起作用?

$(this).modal("close"); 
于 2012-07-10T19:06:59.650 回答
0
     // I get rid of this

            $("#basic-modal-content").modal( {
    onShow : function() {
          // anything you want to do before 
               },
    onClose : function() {
        // when closing popup anything you wanna do 
        var a = this;
        a.close();
    }

    });
于 2012-08-28T06:46:16.153 回答
0

为此,您必须在关闭第一个弹出窗口后打开第二个弹出窗口,大约需要 2 秒。因此,如果您使用 settimeout() 函数并通过提供 2 秒或更长的延迟来调用第二次弹出。它会起作用的。因为,这不是这样做的正确方法。但它实际上对我有用。

我正在使用简单的模态 jquery 插件:这是代码:

$('#forgot_password_modal').click(function (e) {
$.modal.close(); // this is written to close all the popups.
setTimeout(function(){
    $('#forgot_password_form').modal({   //to open a second popup
        minHeight:570,
        minWidth:600,
        maxWidth:671,
        opacity: 90,
    onOpen: function(dialog) {
            dialog.overlay.fadeIn('slow', function() {
                dialog.data.hide();
                dialog.container.fadeIn('slow', function() {
                    dialog.data.slideDown('slow');

                });
            });
        },
        onClose: function(dialog) {
            dialog.data.fadeOut('slow', function() {
                dialog.container.slideUp('slow', function() {
                    dialog.overlay.fadeOut('slow', function() {
                        $.modal.close(); // must call this!
                    });
                });
            });
        }});
}, 2000);    
    return false;
});
于 2012-10-15T07:03:54.940 回答