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.

Best,

Maarten

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

852 views 23 12
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