Does jQuery .dialog() have a default width?
If I don't specify the width parameter for a jQuery modal dialog, what width will the dialog window have 开发者_Go百科when opened?
$(foo).dialog('open')
Is it 300?
Where is it specified?
In the jquery-ui.css
CSS file, line 228
.
If you'd like to override it, just add this chunk of code to your own CSS file and it should work:
.ui-dialog {
width: 400px;
}
http://api.jqueryui.com/dialog/#option-width
It defaults to 300. Change it like so:
$( ".selector" ).dialog({ width: 460 });
Yes, the default width is 300. You can see that in the jQuery UI docs:
width Number Default:300
In the jQuery UI source, you can see that the width
option defaults to 300:
options: {
width: 300
}
The default is indeed 300.
JQueryUI - Dialog
Click the 'options' tab and then scroll down to the width section. The default is listed there.
Default width for jQuery UI Dialog is 300
.ui-dialog .ui-dialog-title {
width: auto;
}
精彩评论