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 vote
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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

370 views 20 10
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