Make JQuery UI Dialog automatically grow HEIGHT to fit its contents (width remains static)
- by Zack Macomber
Having looked into How can I make a 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?
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.