2010-11-18 50 views

回答

2

我想這是因爲:

$.modal('selector'); 

不僅工作這應該工作:

$.modal($('selector')); 
+0

從一個關閉按鈕點擊事件,在彈出的標記,我調用$ .modal.close();明確。 – 2010-11-18 07:39:03

+0

Ok編輯回答相應 – 2010-11-18 07:41:56

+0

感謝marcus求助 – 2010-11-18 09:16:05

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; 
    }); 
相關問題