Problem with iFrame resize in IE 6.0

F

Frank Rosario

Hello all. My page contains an iFrame. I load content dynamically into
the iframe and resize iFrame to fit all of the content. Here's my
problem. When I first enter a page, I set the iFrame's height via the
iframe.style.height. The first time I visit the page and set the
height, it loads the content and resizes it fine. Change around the
content of the iFrame, still no problem with the resize when I can my
resize code. If I visit a link and then go back to the page; the iFrame
loads with the incorrect height (the content is cut off by a shortened
frame). I know frameResize is being called. It even sets the height
correctly. (Confirmed all this with VS.Net debugger). However, it seems
while the style.height property has changed, the browser doesn't
reflect it. For example, if style.height is set to 100, if read
immediately after both the display.height and the height read 100
(confirmed it in the debugger). However, the browser doesn't reflect
the change and height hasn't changed. Any ideas?

My code:
function frameResize()
{
// this gets the height of the contents of the frame
var frameHeight = document.getElementById('fullPageDiv').offsetHeight;

// gets frame reference from parent
var iFrame;
iFrame = window.parent.document.getElementById('contentIFrame');
//set height of frame
iFrame.style.height = frameHeight;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,247
Latest member
crypto tax software1

Latest Threads

Top