Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jan 2009
    Location
    Australia
    Posts
    853
    Tokens
    0

    Default [TUT] Onload="calcheight()"

    If you are getting angry with you're iframes because they do not expand to the correct size, this is a quick and easy way to get them to expand to the correct height.
    Step one:
    insert the following code into the head tags:
    HTML Code:
    <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>
    (replace 'the_iframe with the iframe id.)
    Step Two:
    Put onload="calcheight()" into you're iframe tags (make sure there is no height specified) and you're done!
    __________________________________________________ __________________________________________________ ____________
    Easy or what? I hope you enjoyed it, it's used for more 'novice' coders. I just saw a post with someone asking how to do it.
    Cheap Layout Coding
    PM For Free Quote

  2. #2
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    Tbh people shouldn't be using iframes imo. They are a waste of space.

    Good information though.

  3. #3
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Quote Originally Posted by BoyBetterKnow View Post
    Tbh people shouldn't be using iframes imo. They are a waste of space.

    Good information though.
    IFrames can be useful when used correctly. Oh and I'm sure this code doesn't work in certain browsers.

  4. #4
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    Quote Originally Posted by Invent View Post
    IFrames can be useful when used correctly. Oh and I'm sure this code doesn't work in certain browsers.
    Okay man I hear that. Where would you use iframes and what for?

  5. #5
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Quote Originally Posted by BoyBetterKnow View Post
    Okay man I hear that. Where would you use iframes and what for?
    WYSIWYG editors?

  6. #6
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    Quote Originally Posted by Invent View Post
    WYSIWYG editors?
    Okay fair enough. Content wise you wouldn't use them though right?

  7. #7
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Quote Originally Posted by BoyBetterKnow View Post
    Okay fair enough. Content wise you wouldn't use them though right?
    No, I personally wouldn't use them to display internal content but I would use them for other things

  8. #8
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    Quote Originally Posted by Invent View Post
    No, I personally wouldn't use them to display internal content but I would use them for other things
    Fair enough. We just raped this thread lol.

  9. #9
    Join Date
    Jun 2008
    Location
    West midlands, Birmingham.
    Posts
    2,093
    Tokens
    219

    Latest Awards:

    Default

    Quote Originally Posted by BoyBetterKnow View Post
    Fair enough. We just raped this thread lol.
    You rape alot of things..

    ha joke

    And I don't see whats wrong with iFrames? If you use them correctly, your ok?

  10. #10
    Join Date
    Jan 2009
    Location
    Australia
    Posts
    853
    Tokens
    0

    Default

    Exactly, theres nothing wrong with iframes if used correctly, eg HabboArchive.net
    Cheap Layout Coding
    PM For Free Quote

Page 1 of 2 12 LastLast

Posting Permissions

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