Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    dynamic iframe height; not a function, not defined.

    I'm trying to use a function that I found on these forums to dynamically adjust the height of an iframe, but the page always returns an error stating that "heightboss is not a function" if I use document.heightboss() or "heightboss is not defined" if I just use heightboss(). This is very frustrating. It happens also with any function I put in, so I don't think it has to do with this one particular.

    But here's the code:

    Code:
    <script type="Javascript">
    
    //This code by narmi2 from codingforums.com. Thanks narmi!
    
    function heightboss() {
    var the_height=document.getElementById('content').contentWindow.document.body.scrollHeight;
    	document.getElementById('content').style.height=the_height;
    }
    
    </script>
    This is the code I'm using to call it.

    Code:
    <iframe onLoad="javascript:top.heightboss();" name="content" id="content" width="70%" align="center" frameborder="0" scrolling="no"></iframe>
    Please help.

    It doesn't work in IE either. The error there is "Object doesn't support this property or method".

    Thanks in advance.

  • #2
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    have a look at the code i use here:

    www.enviromark.ca/Project/

    go to Orders -> completed or outstanding orders.

    that what u need?
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #4
    New to the CF scene
    Join Date
    May 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks guys. I'm using that code now, Mr. J, thank you.


  •  

    Posting Permissions

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