简体   繁体   中英

jQuery UI Dialog and maxHeight in Internet Explorer

Here's my current code:

$("#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 works great in Firefox, Chrome, etc. as expected, but IE 7 obviously has a problem with it. Does anyone have any idea how to get the UI dialog to use maxHeight in IE?

<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>

看起来它是一个长期存在的开放jQueryUI错误 - 在这个链接中有一个解决方法中列出的解决方法和补丁。

The link that Dean pointed to has a recent update with a great work-around that worked for me:

Additionally you could apply your own CSS by 'vol7ron'; something like:

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

Therefore, in your case:

$("#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'} );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM