I have a parent div with id contentPlaceHolder. It has a width of 640px. I then have content loading into this div with ajax as follows:
function loadContent(page){
$("#contentPlaceHolder").html('<br><br><div style="width:664px; text-align:center; font-size:12px; color:#666;"><img src="/images/loader.gif" border="0"><br>loading</div>');
$("#contentPlaceHolder").load("/ajax/content?page=" + page);
}
<div onclick="loadContent('profile')">Profile</div>
<div id="contentPlaceHolder" style="width:640px; height:auto; text-align:left;"></div>
problem is, my parent div contentPlaceHolder does not automatically grow with the ajax content. I tried make the div height:auto and that did not help. Only way it seems to work is if I fix a height but problem with that is I cannot fix a height as the content length varies.
Any advice as to how I can achieve this?
Thanks