Page 1 of 1

How to have iframe height adjust automatically based off width - Responsive iframe

Posted: Mon Jan 11, 2021 11:18 pm
by KRitchie
I feel like I am missing something obvious. I am using an iframe to bring in a slideshow that is built in a separate HTML file.

On the hotspot I have the action:
<iframe src="$(hu)" width="100%" height="100%" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>

This feeds into a Target container where I set the size of the iframe. I have width set to 70%, but no matter what I set the height to, I get extra white space below the slideshow. See below - images are blurred due to NDA.
Screen Shot 2021-01-11 at 5.08.47 PM.jpg
Screen Shot 2021-01-11 at 5.08.47 PM.jpg (429.22 KiB) Viewed 215 times
It seems like there should be some CCS code I could enter in the Height field to fix this but I cannot find anything.

Would really appreciate some insight

Thanks
- Kevin

Re: How to have iframe height adjust automatically based off width - Responsive iframe

Posted: Tue Jan 12, 2021 6:23 pm
by KRitchie
The ever knowledgeable Tony Redhead has figured it out.

https://tonyredhead.com/pano2vr-little- ... HPHi4_6JBw

Thanks Tony!

Re: How to have iframe height adjust automatically based off width - Responsive iframe

Posted: Thu Jan 14, 2021 8:45 am
by Tony
You are more than welcome :-)