• ShiftAaron
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies

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>