Resizing iFrames using Javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • John Thomson
    New Member
    • Jan 2011
    • 1

    Resizing iFrames using Javascript

    Hi,

    I'm a little new to javascript, and I'd really appreciate some help. Basically, what I'm looking for, is a way to have 3 iframes lined up side by side on my page. I'd like all three to be width 33% of my page so that, side by side, they fill up the whole width of the page. I'd like to be able to show/hide each of the frames with a button or a div for each. Okay...so far, I've been able to make it all work. Here's where I'm getting stuck: when, say, button 2 is pressed, and iframe 2 disappears, I need to get iframe 1 and 3 to change size to 50% each, so that they fill up the whole page.

    Like I say, I'm new to javascript, and it might be something really simple that I'm missing, but I just haven't been able to figure out how to do this yet. Any help would be much appreciated!
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Use the iframe's width property.

    Comment

    Working...