Dynamic iframe height possible?

  • 1
  • Question
  • Updated 9 years ago
  • Answered
I've been trying to embed another website into my current website so that certain things don't have to reload every time, etc.

I've been using a simple iframe. But I can't figure out how to dynamically adjust the height of the iframe when I navigate the embedded website. I've found ways to dynamically adjust the height of iframes but only by adding code to the page headers or other places that I don't think I have access to with Synthasite.

Is there anyway I can dynamically adjust the height of iframes with just html?
Photo of JFotography


  • 16 Posts
  • 0 Reply Likes
  • stumped

Posted 9 years ago

  • 1
Photo of Christo


  • 95 Posts
  • 13 Reply Likes
Hi JF.

You are correct, to dynamically change the height of your iframe, you would need to use JavaScript. While you can embed this into your site, I would not recommend it.

What might be a better idea, is just to set the height of your frame to something really big.

For example, when amazon gives you code to embed an astore into your website, they set the height to 4000px. It is unlikely that your embedded site will need a higher height than that.

You can set the height of an iframe with the 'height' property.

for example: