Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Problems resizing iframe!

    Hi! I found this code online that could make my iframe vary height depending on its content. It works awsomely in IE, but in mozilla firefox, it's a diffrent story! The frame expands well with the content, but it never shrinks back. Can anyone help me?

    here's my page: www.luckyoswald.net

    For the code, I pasted this in the head of my main page (the one that contains the iframe)
    ------------------------

    <script language="JavaScript">
    <!--
    function calcHeight()
    {
    //find the height of the internal page
    var the_height=
    document.getElementById('the_iframe').contentWindow.
    document.body.scrollHeight;

    //change the height of the iframe
    document.getElementById('the_iframe').height=
    the_height;
    }
    //-->
    </script>

    ------------------------



    and this is my iframe tag
    ------------------------

    <iframe width="741" id="the_iframe"
    onLoad="calcHeight();"
    onload=resize_iframe
    src="blog.htm"
    scrolling="no"
    frameborder="0"
    height="1" marginwidth="1" marginheight="1" name="I1" border="0">
    </iframe>

    ------------------------



    thanks in advance!

  • #2
    Regular Coder
    Join Date
    Mar 2008
    Posts
    301
    Thanks
    2
    Thanked 30 Times in 30 Posts
    There a short routine to get the 'handle' of an iframe's contents in the 4th message in the Add/Hide thread in the post-a-javascript section. It might help.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •