How can I determine proper height of an Iframe subpage?

Discussion in 'Javascript' started by Michael, Sep 13, 2004.

  1. Michael

    Michael Guest

    <A href="http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm">Iframes
    SSI Script II</a>

    My Test page below has a Prayer in it that randomly loads a new prayer
    each time someone clicks on the prayer itself. The 1st prayer does not
    have the proper HEIGHT in it though. Because each prayer is randomly
    selected. Each prayer has a different HEIGHT & WIDTH. For testing
    purposes I have included a test page. You can load the test page to
    see how the prayer does not have the proper HEIGHT IFrame. Then click
    on it to load a new prayer and to see it resize itself. Then feel free
    to examine the Javascript & HTML code to figure out how to get the
    iframe to determine the proper HEIGHT the 1st time when the page loads
    in the browser.

    This script resizes an IFrames HEIGHT when content is loaded into it.
    It works great. The problem is that the first time it appears it does
    not use the proper HEIGHT. I think because I did not give it one. The
    reason I did not give the IFrame a HEIGHT value is because each
    sub-page loaded into it is randomly selected. The HEIGHT & width are
    different each time. I get around the width issue by giving it a value
    of 100%. But how can I get the script to apply the proper Height value
    the first time the page loads?

    Part 2:
    If anyone can help me with the width problem too, that would be
    great!! How can I get the script to resize to the proper HEIGHT &
    WIDTH each time? Because each sub-page in the IFrame is RANDOMLY
    SELECTED.


    Here is the URL for my <a
    href="=http://www.geocities.com/mdh2972/Iframe/IFrames_Test.html">TEST
    PAGE</a>
     
    Michael, Sep 13, 2004
    #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. Leo
    Replies:
    2
    Views:
    522
  2. Bernd Meier
    Replies:
    6
    Views:
    535
    GTalbot
    Jan 14, 2008
  3. szako
    Replies:
    3
    Views:
    247
    szako
    Jun 10, 2004
  4. Daedalous
    Replies:
    3
    Views:
    791
    Daedalous
    Jan 16, 2004
  5. Joe Attardi
    Replies:
    0
    Views:
    540
    Joe Attardi
    Jan 17, 2006
Loading...

Share This Page