I have a div with dynamic content. When the content loads in the div I want the div to resize to fit the content. But I want this resizing to have a maximum height. If the conte
You could do this with css, e.g.: max-height: 100px; overflow-y:scroll;
Use:
<div style="max-height: 400px; overflow-y:scroll; overflow-x: hidden">
<p>Some dynamic content loads inside the div</p>
</div>
Then add: <div style="clear:both"></div>
before closing the "div":
<div style="max-height: 400px">
<p>Some dynamic content loads inside the div</p>
<div style="clear:both"></div>
</div>
div {height:auto;overflow:scroll;max-height:200px;}