View Full Version : Resizing iframe.

06-25-2002, 04:41 PM
Hello, I need some help with js ;)

I have 2 files, index.html and content.html
In index.html I have an iframe named 'ifr' and I load
content.html in it. All I want to do is to change height of that iframe to fit height of the loaded document (content.html).

I made a script in js to do it, but It works only under ie5+. I want it also to work under ie4 and netscape/mozilla.

here's the code:

function resize() {
document.getElementById('preload').style.visibility = "hidden";
if (document.all) {
//alert('width = ' + document.all['lol'].clientWidth + ' height = ' + document.all['lol'].clientHeight);
if(navigator.appName!="Microsoft Internet Explorer") {
document.all = document.getElementsByTagName("*");

This code is from loaded document (content.html), it works with
<body onload=resize();>

Any help would be really appreciated, this is really important for me. Thanks!

Wojciech Drewniak
webdesign:|:internet solutions

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum