I had to do this recently and thought it would be tougher than it ended up being. Here's the code I used:
function adjustMyFrameHeight()
{
var frame = getElement("myFrame");
frame.height = document.body.offsetHeight + 60 + "px"; // add 60 pixels to be safe...
}
function getElement(aID)
{
return (document.getElementById) ?
parent.document.getElementById(aID) : parent.document.all[aID];
}
Then, just simply call the "adjustMyFrameHeight()" method from the child page's BODY onload event:
<body onload="adjustMyFrameHeight();">
Et voila, c'est bon!!
Currently rated 5.0 by 1 people
- Currently 5/5 Stars.
- 1
- 2
- 3
- 4
- 5