Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Even better would be if autoResize in latest branch would work as intended, but till then the question is simple: how to resize a dialog once it is created?
autoResize
The answer from is Soviut is correct for v1.5. 1.6 adds an option method to each plugin:
v1.5. 1.6
option
$(document).ready(function(){ var d = $("#example").dialog(); d.dialog("option", "width", 700); });
Add a comment
dialog()
$('#dialog').dialog().animate({width: "700px"}, 400);
I've used this for dynamically resizing dialogs.
All JQuery UI plugins can have their properties updated using .data():
$(document).ready(function(){ var d = $("#example").dialog(); d.data("width.dialog", 700); });
But the contents of the dialog (.ui-dialog-content) do not follow suit.
I like to have the dialog sized to contents when created so I use this:
var dlg = $("#dialog"); dlg.dialog( { width: 600, height: dlg.height() + 100 });
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.