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

This widget could not be displayed.
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.

Best,

Maarten

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

313 views 2 5
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