Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:03

Iframes resize problem


Poster: susanna
Dated: Monday October 20 2003 - 11:54:55 BST

Hi, I find out a problem with IFRAMES, I found out a script which make a iframe resize...

I put the following code inside head tag:
Code:
<script language="JavaScript">
<!--
function resize_iframe()
{
  document.getElementById("iframeprincipal").height=document.body.offsetHeight-document.getElementById("iframeprincipal").offsetTop-43;//resize the iframe according to the size of the window
}
window.onresize=resize_iframe; //this will resize the iframe every time you change the size of the window.
//Instead of using this you can use: <BODY onresize="resize_iframe()">

//-->
</script>


and I put the following code inside body tag:

Code:
<SCRIPT>
function openIFrame(iFrameId,winURL)
{
   ifId=gmobj(iFrameId)
   ifId.src=winURL
}
</SCRIPT>


Code:
<iframe id='iframeprincipal' width=100%  scrolling="auto" frameborder="0" src="coettc.cgi?tolink=_scfmedio">
  <div align="center" class="white12">
   Su navegador no soporta iFrames, por favor actualice su navegador para ver correctamente estas páginas.
  </div>
</iframe>


This script works fine but the iframe size do not change until all the web page contents load completely.

I try to put this:
Code:
onload='resize_iframe()'

on body tag and don't works.

I try to put this:
Code:
onload='resize_iframe()'

on iframe tag and don't works too.

I tried adding:
Code:
<SCRIPT LANGUAGE="JavaScript">
<!--
resize_iframe();
//-->
</SCRIPT>

and milonic menu STOP WORKING!!!...


Please help meee, my web page is http://www.coettc.net, I'm going crazy!!!!!!!!!!!


Thanks in advance.

Susanna


Poster: Hergio
Dated: Tuesday October 21 2003 - 22:34:14 BST

You have a TON of stuff going on in that iframe. You have to understand. Once that stuff is all done loading THEN the onLoad event fires...thats why its happening. And the Iframe doesn't know what size it will be to report to the parent until its done loading.

You may want to try changing the default initial height of the iframe in the parent window. Instead of being only, about 200-300 px like it looks like, make it bigger like almost what the page SHOULD be. Then at least it won;t be as noticable.