在 Internet Explorer 中自动调整 jQuery UI 对话框的大小
如何在 Internet Explorer 中自动调整 jQuery UI 对话框的大小?
此代码在 Firefox 中可以,但在 Internet Explorer 中不行。
$('#dialog2').dialog({
autoResize: true,
show: "clip",
hide: "clip",
height: 'auto',
width: 'auto',
autoOpen: false,
modal: true,
position: 'center',
draggable: true,
open: function (type, data) {
$(this).parent().appendTo("form");
},
buttons: { "close": function () { $(this).dialog("close"); document.getElementById("<%=btnnew.ClientID%>").click(); } }
});
我的 HTML 元素是一个 DIV。
How can I autosize a jQuery UI dialog in Internet Explorer?
This code is OK in Firefox, but not in Internet Explorer.
$('#dialog2').dialog({
autoResize: true,
show: "clip",
hide: "clip",
height: 'auto',
width: 'auto',
autoOpen: false,
modal: true,
position: 'center',
draggable: true,
open: function (type, data) {
$(this).parent().appendTo("form");
},
buttons: { "close": function () { $(this).dialog("close"); document.getElementById("<%=btnnew.ClientID%>").click(); } }
});
My HTML element is a DIV.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用以下“补丁”(适用于 IE)成功使用
width: 'auto'
调整 jQuery UI 对话框的大小:只需在加载 jquery-ui.js 后加载此代码...
请注意根据票证 http://dev.jqueryui.com/ticket/4437 我们不应该正在使用 width: 'auto' 但我就是不能没有它......:)
I'm having success with
width: 'auto'
sizing jQuery UI dialog using the following "patch" (for IE) :Just load this code after jquery-ui.js has loaded ...
Note that according to the ticket http://dev.jqueryui.com/ticket/4437 we shouldn't be using width: 'auto' but I just couldn't live without it ... :)
请首先在以下行的末尾添加
,
IE 希望通过
,
关闭所有选项让我们看看这是否能解决问题(最好问一下什么IE 版本是否会失败?)
Please first add a
,
at the end of the following lineIE expects that all options be closed off via
,
Let's see if that does the trick (its probably good to ask what version of IE is this failing on?)