I’ve read through tons of posts and articles and haven’t found a fix that works specifically for my problem
My parent page points via iframe to a local child page.
The child page is a php survey which changes height from page to page as the user clicks the next button. (Not really changing pages but re-populating content within one .php file)
I’m trying to have the parent page auto expand and contact height according to the length of the child page.
I have this specific need because I’m working within WordPress and want a PHP application (survey) to be wrapped within the design of the WordPress theme.
Ay help would be really appreciated!
Are the two pages on the same domain? If yes, then the easiest way to achieve this is with JavaScript running on both the parent and the child page.
Here’s a rough idea of how it might work. On the child page:
On the parent page:
You’ll probably need to adjust the height, depending on the margins/borders/etc of the iframe element.
If the two pages are on different domains, this will be much harder. Cross-domain communication between
iframesis difficult, particularly if you want to support older browsers.