iFrame Javascript Minimum Frame Height Issue

Discussion in 'Javascript' started by chasquad, Feb 13, 2006.

  1. chasquad

    chasquad Guest

    I have the following script and iFrame code on the main Internet
    Explorer
    page:

    <td valign="top">
    <p>
    <script type="text/javascript">
    <!--

    moz=document.getElementById&&!document.all
    mozHeightOffset=20

    function resize_iframe(){
    document.getElementById("I1").height=100 // required for Moz bug, value
    can
    be "", null, or integer
    document.getElementById("I1").height=window.frames["I1"].document.body.scrollHeight+(moz?mozHeightOffset:0)
    }
    // -->
    </script>

    <iframe id="I1" name="I1" src="Products%20SubWebs/Products.aspx"
    height="100%" width="100%" border="0" frameborder="0"
    onload="resize_iframe()">
    Your browser does not support inline frames or is currently configured
    not
    to display inline frames.
    </iframe>
    </td>


    I'd like to modify the above javascript so that after it resizes the
    iFrame
    to match the size of the content that is being brought into the screen,
    it
    checks to see if the new iFrame height is below a minimum value. If
    so,
    then it resizes the iFrame again to meet at least the minimum height
    specified (in the code). If the iFrame height is over the minimum
    value
    after the first resizing, then it should do nothing.

    Thanks!
    --
    ---------------------------------------------------------------
    Charles L. Simpson
    ACT, Inc.
    ---------------------------------------------------------------
    Current Setup:
    WSS 2.0 (no service packs)
    Project Server 2003 SP1
    SQL Server 2000 SP3a
    FrontPage 2003 SP2
    -----------------------------------------------------------------
     
    chasquad, Feb 13, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Morris

    Minimum Height of an Iframe

    David Morris, May 14, 2004, in forum: HTML
    Replies:
    1
    Views:
    4,972
    David Dorward
    May 14, 2004
  2. Mark
    Replies:
    3
    Views:
    366
    Andy Dingley
    Nov 28, 2007
  3. Minimum height of web controls

    , Nov 25, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    101
    lotharlinux
    Dec 4, 2006
  4. Replies:
    1
    Views:
    138
    Randy Webb
    Dec 19, 2005
  5. Joe Attardi
    Replies:
    0
    Views:
    512
    Joe Attardi
    Jan 17, 2006
Loading...

Share This Page