How to Resize iframe within an expanding panel?

We have 4+ sites we use at work, which output dynamic text and can vary in length. I have them in iframes within expanding panels. This is useful as you can quickly check them and move on. However, I would like to be able to have the panel resize to fit the content when the page is reloded. Currently, the size is fixed, which makes for lots of scrolling.

1 answer

0 votes
Maarten Cautreels Community Champion May 08, 2017

Hi thejpkotor,

There's two ways to resolve this problem:

  1. Make the 4+ sites responsive so they'll be able to display their content regardless of how wide the iframe/screen is. (By far the best solution, imagine someone using the Confluence page on Mobile)
  2. You could try a JavaScript hack to resize the iframe once it's loaded but some browsers might block that kind of JavaScript behaviour because of security reasons (cross-origin scripting).

Hope this helps.



Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

879 views 45 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you