Change dialog height

Change dialog height


Hi, I have an instance of dialog opened (with 300px width for
example). When I load (and inject) some ajax HTML code which is longer
then dialog window, there is a scrollbar at right (I get it).
Is there some a way how to resize the dialog window automatically (and
prevent the scrollbars)?
Just note. If I write event like:
$('#element').dialog('option', 'height', 500);
the dialog height is changed (DIV element with "ui-dialog" class) but
the inner "#element" - doesn't.
Thanks for any help.
Daniel