When I used the @Steven answer, I have problems with the size of the content, like @jedierikb in the comment. So I created this code and it works.
$(dialogSel).dialog("widget").animate({ width: 100, height: 200 }, { duration: 200, step: function (now, tween) { if (tween.prop == "width") { $(dialogSel).dialog("option", "width", now); } else { $(dialogSel).dialog("option", "height", now); } } });
source share