I found the solution here How to auto shrink iframe height dynamically?
I'm trying to Iframe a forum and i need to autosize increasing and decreasing the size of Iframe.
Now i have this:
<script language="JavaScript" type="text/javascript">
<!--
function autoResize(id){
var newheight;
var newwidth;
if(document.getElementById){
newheight=document.getElementById(id).contentWindow.document .body.scrollHeight;
newwidth=document.getElementById(id).contentWindow.document .body.scrollWidth;
}
document.getElementById(id).height= (newheight) + "px";
document.getElementById(id).width= (newwidth) + "px";
}
//-->
</script>
<iframe frameborder="0" height="200px" id="iframe1" marginheight="0" onload="autoResize('iframe1');" src="/forum" width="100%"></iframe>
But this code only increase the size and i need also decrease the size.
Thanks.