Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can I resize an iframe in apex based on available space on screen using a button

greichDec 6 2013 — edited Dec 6 2013

Hi.  I have an application in apex 4.2.2.00.11, oracle llg database.  The requirements for this application are to hide and show a navigator bar by clicking hides/show buttons on  the screen.  The right side of the screen has an iframe that needs to fill whats left of the of the web browser's real estate.  Searching in google, I found a function that works on load.  I need the iframe to resize when the navigator hides and shows, but when I tried to create a on click dynamic action to call the javascript, the hide and show functionality of the navigator bar breaks.  The iframe also doesn't resize.

Below is the code I am currently using.

Javascript in my page header

<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 region source.

<IFRAME SRC="f?p=&I_FRAME_APEX_APP_ID.:&I_FRAME_APEX_PAGE_ID.:&APP_SESSION.

::NO::ROLE:&ROLE." width="100%" height="200px" id="iframe1" marginheight="0" frameborder="0" onLoad="autoResize('iframe1');"></iframe>

This post has been answered by greich on Dec 6 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 3 2014
Added on Dec 6 2013
1 comment
1,752 views