Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2008
    Posts
    3,711
    Tokens
    100

    Latest Awards:

    Default [TUT] How to make expandable iFrames

    Hello,
    Many people are asking about how they can make expandable iFrames.
    So i decided you give you all the code

    Here's the IFRAME CODE:
    <script type="text/javascript">
    //<![CDATA[
    window.onload = function() {
    var f = document.getElementById("mainframe");
    function resize() {
    var h = "";
    var w = "";
    if (f.contentDocument) {
    h = f.contentDocument.documentElement.offsetHeight + 20 + "px";
    (f.contentDocument.documentElement,"").getProperty Value

    ("width");
    } else if (f.contentWindow) {
    h = f.contentWindow.document.body.scrollHeight + 5 + "px";
    } else {
    return;
    }
    f.setAttribute("height",h);
    f.parentNode.setAttribute("height",h);
    }
    if (window.addEventListener) {
    f.onload = resize;
    } else if (f.attachEvent) {
    f.attachEvent("onload", resize);
    } else {
    return;
    }
    resize();
    }
    //]]>

    </script>

    <iframe name="frm" id="mainframe" src="URL HERE" frameborder="0" allowtransparency="no" scrolling="no" target="_self" height="150"></iframe>
    And here's the HTML code:
    <a href="URL OF PAGE" target="content">Name Of Page</a>
    Hope this helped,

    Meti

  2. #2
    Join Date
    Apr 2005
    Posts
    4,614
    Tokens
    1,290

    Latest Awards:

    Default

    Why have you put the link target as "content" when there is no frame called "content"

  3. #3
    Join Date
    Jan 2008
    Posts
    3,711
    Tokens
    100

    Latest Awards:

    Default

    I'm sorry. My misstake.
    It should be
    <a href="URL OF PAGE" target="I1">Name Of Page</a>

  4. #4
    Join Date
    Apr 2006
    Location
    London, England
    Posts
    696
    Tokens
    0

    Default

    Theres not a frame called that either lol.

    But good tutorial
    ;veni vidi vici
    ;i came, i saw, i ownt

  5. #5
    Join Date
    Jan 2008
    Posts
    3,711
    Tokens
    100

    Latest Awards:

    Default

    <a href="URL OF PAGE" target="frm">Name Of Page</a>
    That then?

  6. #6
    Join Date
    Aug 2005
    Location
    London
    Posts
    9,773
    Tokens
    146

    Latest Awards:

    Default

    Quote Originally Posted by Meti View Post
    That then?
    Nope, the target frame should be called 'mainframe' as that's the frame the javascript will be looking for and expanding:
    HTML Code:
                     var f = document.getElementById("mainframe");

  7. #7
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    There is no way you created that code, I know who did.

    Are you using it with permission?

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

    Latest Awards:

    Default

    There is no way you created that code, I know who did.

    Are you using it with permission?
    I agree that he should have permission if it wasn't released for free but it's not exactly the hardest thing to code is it, lol.

  9. #9
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    It's from Dynamic Drive, nobody even cares about that site anymore. They're the no. 1 supplier of annoying scripts to even more annoying people.


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

  10. #10
    Join Date
    Jan 2008
    Posts
    3,711
    Tokens
    100

    Latest Awards:

    Default

    It's from Dynamic Drive.
    I took it a while ago, when i had my fansite going.

Posting Permissions

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