You need to sign in to do that
Don't have an account?

Resize IFrame?
Is it possible to resize an iframe within a VisualForce page? I have a script that would work, but the apex:iframe does not allow OnLoad()
<script language="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 src=" " width="100%" height="200px" id="iframe1" marginheight="0" frameborder="0" onLoad="autoResize('iframe1');"></iframe>
Use Apex:Iframe tag with height and width values passed from Controller.
<apex:iframe src="...." height="{!frameHeight}" id="fId"/>
In Onload pass the values of height and width to controller and rerender the iframe once the onload gets finished.
Best regards
I'm looking to do the same. Were you able to get this working?
Hi,
I have tried auto resizing of iframe but it did not worked if i use <apex:iframe> tag.
Is it possible by using that standard tag and not using simple html tag of <iframe> ??