Forum Moderators: phranque

Message Too Old, No Replies

Making a page fit the height of 3rd party iFrame

         

csdude55

12:21 am on Jul 19, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm working with an affiliate company that provides an iFrame that I embed to my page.

The problem is that the height of their iFrame changes dynamically, and it scrolls vertically separately from my page.

Can you guys suggest a way that I can modify my page to match the height of the iFrame? I can't change it on their end, all I can change is the container page on my end.

My options are Javascript, jQuery, CSS, or PHP if you can think of a way to do it server-side.

keyplyr

12:37 am on Jul 19, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Put their iFrame in a <DIV> which you control size with CSS. Experiment what sizing units work best... em, percentages, etc.

csdude55

1:32 am on Jul 19, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Well, I think it's gonna have to be changed on their end... it looks like they have a predefined height of 775px, so no matter what I do it's going to scroll

not2easy

1:57 am on Jul 19, 2018 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



If they've designed it to have a fixed height, you'll need to contain it where it can be shown at that height or tolerate the scrolling. Can it be located on its own page where that would be manageable?

keyplyr

2:34 am on Jul 19, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



it looks like they have a predefined height of 775px


I thought you said it changes dynamically
height of their iFrame changes dynamically

csdude55

2:42 am on Jul 19, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I did say that, but then I opened the iFrame outside of my page and saw that it was still 775px. So I was wrong in my original post.

I emailed them, and hopefully they can set a variable or something for me to change that so that it will be dynamic like I thought. If so, I'll post back and see if there's any way to make it look the way I want.