我正在尝试更改初始化后的JQuery对话框的宽度。以下是我的初始化:
$(function() {
$("#dialogContainer").dialog({
title: 'Some title',
resizable: false,
bgiframe: true,
overlay: { opacity: 0.3, background: "white" },
position: [200, 200],
autoOpen: false,
height: 150,
width: 'auto'
modal: true,
buttons: {
'ok': function() {
$(this).dialog('close');
}
}
});
});
这就是我在其他函数中改变它的宽度的方法:
$("#dialogBox").dialog('option','width',700);
但这不管用。对话框的宽度是第一个显示在其中的段落的宽度。我还能做别的什么吗?
下面是对话框的html:
<div id = 'dialogContainer'>
<p id = 'message'></p>
</div>
发布于 2009-05-18 12:56:42
确保您使用的是ui.resizable.js和ui.resizable.css
发布于 2014-03-01 20:32:05
以下是简短的解决方案,但请记住,它仅适用于预定义的对话框。
$( "#dialog" ).dialog({minHeight: 300,minWidth:500});
发布于 2009-06-01 20:58:11
试试这个:
$("#dialogID").data("width.dialog", 160);
https://stackoverflow.com/questions/877573
复制相似问题