How to Resize iframe within an expanding panel?

thejpkotor May 8, 2017

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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 8, 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
TAGS
AUG Leaders

Atlassian Community Events