Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Victor Cooper on April 8, 2010 at 5:18 pm

    Hi all,

    I am pretty new to web design and I am using a resizable iframe. It is working great for when the page is loaded inside of theiframe. My problem is that I have an accordion on one of the pages that when first loaded is only 500px high and the iframe adjusts fine, but when you open the accordion it grows to over 1000px high and the overflow just disappears in behind the iframe. Is there some javascript that will allow the iframe to grow as the page content grows? Am I making any sense?

    Thanks

    Victor.

    Curtis Thompson replied 16 years, 4 months ago 2 Members · 3 Replies
  • 3 Replies
  • Curtis Thompson

    April 8, 2010 at 5:36 pm

    hello…

    short answer is that you need to adjust the height of the iframe as the page height changes…so any time you change the height of the page via some other element, you need to figure out the page height (search “page height javascript” (sans quotes) in google to learn more about that) and then assign that height (or some subset of it) to the iframe…

    sitruc

  • Victor Cooper

    April 8, 2010 at 6:41 pm

    Hi Curtis,

    Thanks for the quick reply. This sounds like an extremely time consuming way to do things. I have accordions with ten to twelve drop down menus all different sizes and all changing daily. Changing the code that often would be insane.

    Is there perhaps a completely different route that I can take? I have a footer below the iframe that floats up or down according to the iframe size and that works nicely but the iframe still needs to resize when page content resizes.

    Thanks,

    Victor.

  • Curtis Thompson

    April 8, 2010 at 7:16 pm

    hello…

    if your accordion is not in a global file then ya – it will be hard to do, but if you want to change the height of the iframe as the page height changes, you will have to do something similar to what i’ve described here. there is no quick fix to tell a component to automatically resize itself to a specific height in relation to another element…

    w/o seeing your situation, i can’t say, but you could also potentially make the height of the iframe a % value, but i doubt it would get you what you need…

    hard to offer much else w/o a working example of your site, i’m afraid…

    sitruc

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy