www.webdeveloper.com
Results 1 to 8 of 8

Thread: Iframe Help!!!! PLEASE!

  1. #1
    Join Date
    Dec 2002
    Posts
    9

    Exclamation Iframe Help!!!! PLEASE!

    Ok this is what I need...Lets say I have a page with an iframe on it. And I click a link that loads in the iframe, but the page that is loading in the iframe is bigger then the iframe so it will obviously have scrollbars in it. I'm trying to find a script that will stretch the iframe to the exact size of the page that is being loaded in it, so there is no need for any iframe scrollbars... if your wondering if I should do scrolling="0", That won't work because the whole page is still not visible in the iframe know what I mean?


    If anyone has a solution or a Script I'm seriously begging you for it!!! Thanks in Advance!

  2. #2
    Join Date
    Dec 2002
    Location
    Seattle, WA
    Posts
    1,843
    this will work for ya
    you must set the height and width to what you need it to be.
    the scrolling attribute can only be set to "auto"; "yes"; or "no".

    <html>
    <head>
    <title></title>
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function resize(obj,w,h){
    if (document.getElementById || document.all) {
    SD = document.getElementById(obj).style || document.all[obj].style;
    }
    SD.width = w;
    SD.height = h;
    }
    //-->
    </script>
    </head>
    <body>
    <a href="http://www.#.com" target="myFrame" onClick="resize('myFrame',400,400)">link</a><br>
    <iframe src="none" frameborder="1" scrolling="no" name="myFrame" id="myFrame"></iframe>
    </body>
    </html>

  3. #3
    Join Date
    Dec 2002
    Posts
    9
    Thanks, The script does work, but instead of putting in the exact page height/width for every page, is there anyway to edit the script to make it recognize the size of the page that is being loaded in it automatically?? Thank again!

  4. #4
    Join Date
    Dec 2002
    Location
    Seattle, WA
    Posts
    1,843
    i don't think it is possible; who knows maybe sombody can figure it out

  5. #5
    Join Date
    Dec 2002
    Posts
    19
    What???

    Load a page in the iframe

    Option 1 -- make your Iframe bigger
    Option 2 -- load the page in a new window

    or just put up with a scorll bar that allows the user to see the whole page

    OH.. Scrolling is YES and NO only

  6. #6
    Join Date
    Dec 2002
    Posts
    19
    What???

    Load a page in the iframe

    Option 1 -- make your Iframe bigger
    Option 2 -- load the page in a new window

    or just put up with a scorll bar that allows the user to see the whole page

    OH.. Scrolling is YES and NO only

  7. #7
    Join Date
    Dec 2002
    Posts
    9
    Take a look at www.xstem.com, and see why I needed that script. If you can figure it out good, if you can't too bad I'm not going to explain it.

  8. #8
    Join Date
    Dec 2002
    Location
    Perth, Western Australia
    Posts
    55
    The technique of split and DESTROY! I mean CONQUER!

    First, determine if you can find the width of the window from inside the window. Like, if you have a table (with everything else inside) with a fixed width, use JavaScript to find out its width and height.

    Then, from the page you load, you can control the iframe size by saying
    Code:
    top.iframename.width=thewidth;
    and similar for the height. top here means the top element, as you might have guessed.

    Try this.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles