View Full Version : Another iFrame problem...please dont shoot

Dec 1st, 2006, 10:44 PM
Well okay, I have done quite a bit of searching and have used numerous sets of code (javascript to be more specific) to find a way to automatically resize my iFrames. Now I found a bunch of old threads from back in 2005 but the thing is, their code no longer works for firefox v2 nor the brand new IE. Basically right now I am starting from scratch.

I have a home page, index.htm. with an iFrame called "iFrame". and I am going to be loading in about 100 different frames (when selected by the flash navigation).

If I had it my way I would have done this site in coldfusion, but it's my high school's website and they are broke, sooooooo, Any help would be appreciated. I want it to mostly work in Firefox, and If you can help me make it work across all browsers that would be great. Also, I have read a lot of your threads before I registered and am very impressed with the wealth of knowledge you guys have. Thanks.


Dec 2nd, 2006, 01:16 PM
bump. Really need some help here guys.


Dec 4th, 2006, 05:17 AM
Here is the javascript to resize an iframe to fit whatever content you link to it.

<script language="JavaScript">
function resize() {
var iframe = document.all.stretch;



<iframe src="default_page_in_iframe_goes_here.htm" name="stretch" scrolling="no" width="100%" frameborder="0" onload="resize()">Your browser does not support inline frames or is currently configured not to display inline frames. </iframe>


Dec 4th, 2006, 05:25 AM
@flavorwrench that code will only work in IE and maybe Opera.

@ali//325i Try the one found here http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm

Dec 4th, 2006, 05:40 AM
thanks. I appreciate it guys. Got it all working in New IE, New Firefox, have no clue about mac's but then again I don't program for 10% of the computer market lol.