2012-03-12 71 views
0

我發現this thread基本上我有同樣的問題。但他們的解決方案並不適合我。jQuery對話框不是第二次打開

這裏是我的代碼:

$(document).ready(function() { 

    // create the loading window and set autoOpen to false 
    $("#loadingScreen").dialog({ 
     autoOpen: false, // set this to false so we can manually open it 
     dialogClass: "loadingScreenWindow", 
     closeOnEscape: false, 
     draggable: false, 
     width: 460, 
     minHeight: 50, 
     modal: true, 
     buttons: {}, 
     resizable: false, 
     open: function() { 
      // scrollbar fix for IE 
      $('body').css('overflow','hidden'); 
     }, 
     close: function() { 
      // reset overflow 
      $('body').css('overflow','auto'); 
     } 
    }); // end of dialog 

}); 


function waitingDialog(waiting) { 
    $("#loadingScreen").html(waiting.message && '' != waiting.message ? waiting.message : 'Bekleyin...'); 
    $("#loadingScreen").dialog('option', 'title', waiting.title && '' != waiting.title ? waiting.title : 'Yükleniyor'); 
    $("#loadingScreen").dialog('open'); 
} 

謝謝...

+0

正常工作對我來說:HTTP: //jsfiddle.net/j08691/dawb9/1/ – j08691 2012-03-12 16:23:14

回答

0

使用$("#loadingScreen").dialog('option' ....只有一次,然後調用$("#loadingScreen").dialog('open')多次,因爲你需要

+0

可以根據需要隨時更改選項,然後再打開 – charlietfl 2012-03-12 23:05:16

+0

感謝您的答案,但它不起作用。 – 2012-03-13 07:42:01