使JQuery UI对话框自动增加HEIGHT以适合其内容(宽度保持静态) [英] Make JQuery UI Dialog automatically grow HEIGHT to fit its contents (width remains static)
问题描述
已经研究了,我在构建jQuery模态对话框时使用了height: "auto"
选项:
Having looked into Make JQuery UI Dialog automatically grow or shrink to fit its contents, I am using the height: "auto"
option when building a jQuery modal dialog box:
$( "#dialog-message" ).dialog({
autoOpen: false,
width: "400",
height: "auto",
show: "slide",
modal: true,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
}
}
});
但是,高度并未增长"以适应所有内容.我仍然在此图像中看到一个垂直滚动条:
However, the height isn't "growing" to fit all of the contents. I'm still seeing a vertical scrollbar as in this image:
在我列出的定义代码中是否有正确的方法可以确保高度增长到足以使垂直滚动条不显示的程度?或者,在打开对话框之前,我是否需要以编程方式执行此操作?
Is there a way right in the definition code I listed to ensure that the height grows enough so that a vertical scrollbar doesn't show? Or, do I need to do this programmatically before opening the dialog box?
编辑1
不知道为什么,但是Chrome可以正常显示,但IE 8却不能.我需要它来专门在IE 8中工作,所以我相信我只会在文本的底部留出空白.
Edit 1
Not sure why, but Chrome is displaying this fine but IE 8 isn't. I need it to specifically work in IE 8 so I believe I'm just going to put a bottom margin on the text.
推荐答案
为使对话框自动增长,我所做的一切
This all I have done for the dialog box to grow automatically
$("#edit_dependent").dialog({
autoOpen:false,
modal:true,
width:800,
position:["center",20],
minHeight:"auto"
});
这篇关于使JQuery UI对话框自动增加HEIGHT以适合其内容(宽度保持静态)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!