2010-12-21 69 views
3

這裏是我當前的代碼:jQuery UI的對話和maxHeight在Internet Explorer

$("#DialogScroll").dialog({ 
       bgiframe: true, 
       autoOpen: false, 
       maxHeight: 600, 
       width: 550, 
       modal: true, 
       resizable: false, 
       open: function (type, data) { 
        $(this).parent().appendTo("form"); 
       }, 
       close: function() { } 
      }); 

maxHeight在火狐,Chrome等如預期的偉大工程,但IE 7顯然有問題的。有沒有人有任何想法如何讓用戶界面對話框在IE中使用maxHeight?

<div id="DialogScroll" class="dialog" style="display:none; "> 
     <table> 
      <thead> 
       <tr> 
        <th> 
         State Code 
        </th> 
        <th> 
         State Name 
        </th> 
       </tr> 
      </thead> 
      <tbody> 
       <asp:Literal ID="litStates" runat="server" /> 
      </tbody> 
     </table> 
    </div> 
+0

什麼問題,到底是什麼? (我假設它可以比它的maxHeight更大,但我想確保。)您還可以粘貼#DialogScroll,以便我們可以在此處看到它?謝謝。 – JasCav 2010-12-21 22:38:06

+0

添加了對話框的內容。發生的事情是,maxHeight設置爲600,空白全部消失,這很好,但我實際上可以設置表(它是jQuery數據表插件的一部分)以顯示更多記錄。比方說50,它超過了IE中的maxHeight。 – jlrolin 2010-12-22 14:04:27

回答

5

看起來它是一個長期open jQueryUI bug - 在這個環節還有一個變通辦法,並在註釋中列出的修補程序。

3

迪安指出,該鏈接有很大的變通爲我工作最近更新:

此外,你可以通過「vol7ron」將自己的CSS;是這樣的:

$('#dialog') 
    .dialog({ modal : true }) 
    .css({ 'max-height' : '50px' }); 

因此,你的情況:

$("#DialogScroll").dialog({ 
    bgiframe: true, 
    autoOpen: false, 
    width: 550, 
    modal: true, 
    resizable: false, 
    open: function (type, data) { 
     $(this).parent().appendTo("form"); 
    }, 
    close: function() { } 
}).css({ 'max-height' : '600px'});