I'm using an iframe to pull content from my own server. The iframe width is set to 100% but it is getting cut off on the right side when I view in IE6. FireFox3 and Safari are fine. When I use the following javascript onload to get variable height, the width comes up fine, but if click on an embedded link that reloads the page, the width gets messed up again. (Btw, this is Joomla code if anyone recognizes it.) function iFrameHeight() { var h = 0; if ( !document.all ) { h = document.getElementById('blockrandom').contentDocument.height; document.getElementById('blockrandom').style.height = h + 60 + 'px'; } else if( document.all ) { h = document.frames('blockrandom').document.body.scrollHeight; document.all.blockrandom.style.height = h + 20 + 'px';} } Code (markup): I can fix that by modifying the code to use something I found in a MS KB article (//support.microsoft.com/kb/278469). function iFrameHeight() { var h = 0; if ( !document.all ) { h = document.getElementById('blockrandom').contentDocument.height; document.getElementById('blockrandom').style.height = h + 60 + 'px'; } else if( document.all ) { var oBody = blockrandom.document.body; var oFrame = document.all("blockrandom"); oFrame.style.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight); oFrame.style.width = oBody.scrollWidth + (oBody.offsetWidth - oBody.clientWidth); } Code (markup): However, now the problem is that when I resize the window, it doesn't change the width and the frame overruns other parts of my page. Blarg! Does someone have a clean solution for this?
i'm curious, why are you using an iframe and not loading content from your server into a div as an include? that way the height of the div is rendered according to the content as the page itself is rendered.
The content I'm referring to is phpBB, the whole application. I want it to appear embedded in my CMS.
ah, i understand. it seems to me that this is what you are looking for: dynamicdrive.com/dynamicindex17/iframessi2.htm (sorry for the whacko looking link. still can't post links here. still my first week.)