Results 1 to 6 of 6

Thread: iframe fluid height?

  1. #1
    Join Date
    Feb 2009
    Location
    Kansas City, KS
    Posts
    24
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default iframe fluid height?

    Is there a way were I can have fluid height on an iframe? My site is just basically and iframe and I don't want to have to add a scroll box on my site, well two of them.

    HTML Code:
    <iframe src="http://twitter.com/alterposer" style="width: 100%; height:1500px" name="internal"
    scrolling="yes" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0">
    </iframe>
    I also wanted to ask if there's a way to make a CSS column to have fluid height was well. I want to keep the fixed width though.

    Code:
    #leftcolumn { 
     color: #000;
     border: 1px solid #080808;
     margin: 0px 5px 5px 0px;
     padding: 10px;
     height:1500px;
     width: 955px;
     float: left;
     background: #080808;
    }
    Any help would be great.

    Thanks.
    Ap
    Last edited by Snookerman; 05-10-2009 at 08:18 PM. Reason: added “Resolved” prefix

  2. #2
    Join Date
    Feb 2009
    Location
    Kansas City, KS
    Posts
    24
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Talking I'm an Idiot

    So basically I'm an idiot because I was looking at the code and then I was like OHHH just change the px to 100% and I assumed to do the same thing with the CSS part but it didn't really work. So can any help on that one instead?

    Thanks,
    Ap

  3. #3
    Join Date
    Feb 2009
    Posts
    23
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    don't think it's possible for an iframe, not sure

  4. #4
    Join Date
    Feb 2009
    Location
    Kansas City, KS
    Posts
    24
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Okay so I was looking around the main site and found THIS. Is there a way to combine this with the iframe??

    @NDK thanks anyways

  5. #5
    Join Date
    Oct 2008
    Posts
    60
    Thanks
    2
    Thanked 7 Times in 7 Posts

    Default

    Why dont you use auto iframe height on content load?

    What i am talking about is this. This will go in the head section of your main page.

    Code:
    <script>
    function adjust_iframe_right_height(h) {
          if (h==0)
          document.getElementById("iframe name").src = document.getElementById("iframe name").src;
    document.getElementById("iframe name").style.height = h;
    }
    </script>
    Then for each page that is going to be loaded in the iframe use this code

    Code:
    <script>
    function adjust_Size() {
          parent.adjust_iframe_right_height(document.body.scrollHeight);
    }
    </script>
    <body onLoad="adjust_Size();">

  6. The Following User Says Thank You to fobos For This Useful Post:

    AlterPoser (05-10-2009)

  7. #6
    Join Date
    Feb 2009
    Location
    Kansas City, KS
    Posts
    24
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thanks that's really helpful. Dang srry for the late reply.

Bookmarks

Posting Permissions

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