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>