If you are using jQuery UI, they already have a class the works just a charm
add a <div>
at the bottom inside the div that you want expand with height:auto;
then add a class name ui-helper-clearfix or use this style attribute and add just like below:
<div style=" clear:both; overflow:hidden; height:1%; "></div>
add jQuery UI class to the clear div, not the div the you want to expand.