我有一个 jQuery UI 对话框,我已经设法改变了容器(外框)的宽度,但是其中的内容似乎是固定的:
这是 HTML:
<div id="dialog" width="500px" title="Animal" style="display:none">
<center>
<input type="text" class="input" />
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
</center>
</div>
这是 jQuery:
function check_domain_input()
{
$( "#dialog" ).dialog({
resizable: false,
modal: true,
width:'800',
height:'500'
});
$("#dialog").css("width", "260px");
var domain_val = document.getElementsByName('domain');
if (domain_val[0].value.length > 0)
{
return true;
}
$( "#dialog" ).dialog({modal: true});
return false;
}
需要帮助让内容适合整个盒子
注意滚动条,它是内容的大小......它不会超过这一点
最佳答案
只是从这里删除宽度
function check_domain_input()
{
$( "#dialog" ).dialog({
resizable: false,
modal: true,
width:'800',//remove this
height:'500'
});
在这里你可以根据你的要求使用 !important do like this 来设置宽度
<div id="dialog" width="300px !important" title="Animal" style="display:none">
关于javascript - jQuery UI 对话框内容宽度不会改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22986194/