View Full Version : Auto-Length iFrame (Rapidweaver)
mmzplanet
Jun 22, 2006, 01:53 AM
On this site, http://www.austenduncanracing.com, I would like to use the iFrame for the forum that is on the site. But because the length is different for each view (posts, main, calendar, etc) how can I get the iFrame to auto-adjust to the length of the content on the page to avoid the scroll bar in the frame?
mmzplanet
Jun 25, 2006, 07:49 PM
anybody have any ideas? :cool:
wmmk
Jun 25, 2006, 08:24 PM
I'm a bit confused as to what you mean.
Oryan
Jun 25, 2006, 08:35 PM
I used this code to solve the same kind of problem on a website I made. Just be sure to call the setFrameHeight() function from body.onload or where ever is relevant in your code. :)
<script type="text/javascript">
function setFrameHeight() {
frame = window.document.getElementById('forum_iframe_id');
innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
objToResize = (frame.style) ? frame.style : frame;
if(innerDoc.body)
objToResize.height = innerDoc.body.scrollHeight+"px";
else
objToResize.height = "100%";
}
</script>
vBulletin® v3.6.10, Copyright ©2000-2009, Jelsoft Enterprises Ltd.