Web Analytics Made Easy -
StatCounter Resizing iframe. - CodingForum

Announcement

Collapse
No announcement yet.

Resizing iframe.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Resizing iframe.

    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:

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


    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
Working...
X