Fitting iframes to page

Discussion in 'HTML & Website Design' started by MelogKnaj, Nov 16, 2008.

  1. #1
    Is it possible to resize iframes so they fit to the size of your browser page without javascript? And yes, I have a good reason for using iframes. Thanks in advance for the help.
     
    MelogKnaj, Nov 16, 2008 IP
  2. e-mail2u

    e-mail2u Well-Known Member

    Messages:
    249
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #2
    Yes just change the width and height to suit your needs in the javascript coding.
     
    e-mail2u, Nov 16, 2008 IP
  3. MelogKnaj

    MelogKnaj Active Member

    Messages:
    233
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #3
    I know how to do it with javascript, but it's clunky and won't work for users with noscript enabled in their browser. Is there any more elegant solution?
     
    MelogKnaj, Nov 16, 2008 IP
  4. e-mail2u

    e-mail2u Well-Known Member

    Messages:
    249
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #4
    What exactly are you putting in the iframe
    example:-
    Video, webpage,image

    An i frame is a javascript code other than that try using it as an insert image html code..
     
    e-mail2u, Nov 16, 2008 IP
  5. bread102

    bread102 Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    <iframe width="100%" height="100%" src="the frame you want"></iframe>

    that code should work
     
    bread102, Nov 16, 2008 IP
  6. MelogKnaj

    MelogKnaj Active Member

    Messages:
    233
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #6
    The frames will still overlap depending on the size of the browser window. I can't believe there isn't a good way to format frames to fit smoothly together like you can with any other html page.
     
    MelogKnaj, Nov 16, 2008 IP
  7. VarriaStudios

    VarriaStudios Member

    Messages:
    246
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #7
    <iframe frameborder="0" align="left" height="100" width="200" scrolling="yes" src="subpage.html"></iframe>

    resizing for frames can be control by width
     
    VarriaStudios, Nov 16, 2008 IP
  8. MelogKnaj

    MelogKnaj Active Member

    Messages:
    233
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #8
    I want the frames to be of variable width depending on the size of the browser window. Is there a variable I could change width and height to to achieve this?
     
    MelogKnaj, Nov 17, 2008 IP
  9. nicky s

    nicky s Peon

    Messages:
    199
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    you will jsut have to keep changing the sizes to you find one that fits, i didnt use JS on my site jsut did the hole think using html
     
    nicky s, Nov 17, 2008 IP
  10. MelogKnaj

    MelogKnaj Active Member

    Messages:
    233
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #10
    Problem is if you have users with browsers at different sizes the iframes will overlap if you set it at a fixed height/width. Guess I will just have to use javascript.
     
    MelogKnaj, Nov 17, 2008 IP
  11. jeeberman

    jeeberman Guest

    Messages:
    141
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #11
    jeeberman, Nov 17, 2008 IP
  12. thefandango

    thefandango Active Member

    Messages:
    787
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #12
    Im confused, cant you just use percentage widths and heights so they automatically adjust whatever the window size?
     
    thefandango, Nov 18, 2008 IP
  13. MelogKnaj

    MelogKnaj Active Member

    Messages:
    233
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #13
    Yeah that's pretty much exactly what I'm talking about, could you post/pm the code you used to accomplish this by any chance?

    Setting it to percentages will adjust the window size and make the iframe scrollable, which is a hassle for users.
     
    MelogKnaj, Nov 18, 2008 IP
  14. saxDesigns

    saxDesigns Peon

    Messages:
    491
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #14
    saxDesigns, Nov 18, 2008 IP
  15. MelogKnaj

    MelogKnaj Active Member

    Messages:
    233
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #15
    The issue is I have two iframes loading from a site I do not control. Right the iframes can overlap one another if depending on the size of the users browser window. I want a way to have the frames load one after the other without any extra white space or overlap.

    It looks like the javascript method won't even work because the pages I want to put in the frame are hosted off site.
     
    MelogKnaj, Nov 18, 2008 IP
  16. wdstuff54

    wdstuff54 Well-Known Member

    Messages:
    639
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    110
    #16
    Did jeeberman ever post code from his example? I'm interested in this as well.
     
    wdstuff54, Nov 19, 2008 IP