I have a jQuery dialog that loads its content trough ajax after its opened.
See this JSFiddle (content is not loaded trough ajax but added after open, which is enough to demonstrate my problem).
html:
<div id="test">test</div>
js:
$("#test").dialog({
minHeight:100,
maxHeight:200,
width:300,
open: function(){
$(this).html("test<br /><br />test<br />" +
"<br />test<br /><br />test" +
"<br /><br />test<br /><br />" +
"test<br /><br />test<br />" +
"<br />test<br /><br />test");
}
});
When it is opened it does not stay true to its maxHeight until you resize the dialog. Is there some sort of resize method I can call after I added content to the dialog?
I prefer not to have to manually figure out if a resize is needed and how high since its pretty much already built into the ui plugin.
JSFiddle example.
Not exactly the elegant solution I hoped for but so far it seems to work.
If anybody has a better solution I’ll be glad to hear it.