View Full Version : Using iframe SSI IV with an iframe in wordpress.

06-26-2012, 03:35 AM
Script: DD iframe SSI IV

Sorry, right after posting this, I realized I could cut the wordpress out entirely and just write a simple html page. I did that and I have the same issue, so it must be the page inside the iframe that's causing my issue. Most likely the iframe site is not reporting its height properly. Does anyone have any insight on how I might be able to force that? I left the rest of the post just because I'm still ultimately trying to get this working on wordpress.

I’m looking for some help incorporating iframe SSI IV into my wordpress site. I'm trying to add an HTML site to my wordpress site inside an iframe. I want that iframe to adjust to the size of the HTML site dynamically. I am currently using the “iframe” addon to generate the iframe, but I have used several others without any success. The HTML site is hosted from within my wordpress folder, so there shouldn’t be any cross domain issues. If anyone is aware of a script that they know works in wordpress (I am using 3.4) I would appreciate some direction on this.

Currently I am using this method. It does dynamically resize my iframe once, but it shrinks it to about 100px height then just leaves it there. I suspect I may have an issue with my HTML site not providing the height information correctly, but that's just a guess. If anyone could expand on this that would be great. Is there a way to force the height information maybe? On my site, this is the iframe1 page.

I also tried a different version of of iframe SSI IV that I found above, with pretty much the same problem I had with the first version I tried. On my site, this is the iframe 3 page.

I have also tried the iframe SSI II version, with no success.

Looking into other methods, I tried this, but it did not work in my wordpress site. Not sure if wordpress is the issue or if the code needs to be changed. If anyone had another version of this available, I would love to try it. On my site, this is the iframe2 page.

UPDATE: the issue was with the site. I suspect that the sites container was causing issues, but I'll never know. Ive switched to manually setting the iframe size using this script:

<script type="text/javascript">
function resizeIframe(iframe, fake) {
document.getElementById(iframe).height= (fake) + "px";

then I just use onclicks like so:

onclick="parent.resizeIframe('iframe1', 500);"

Not optimal, but it works in my case as each page will be static. I'll just have to specify the height of each one.

06-26-2012, 08:47 AM
Hiya BloodySyphon,
This (http://http://stackoverflow.com/questions/9243348/trying-to-dynamically-resize-height-of-iframe-that-is-pointing-to-a-local-php-pa) link may help you

06-26-2012, 04:58 PM
Your links a little messed up. I tried the method though, and it is not working.

So I've tried probably about a half a dozen dynamic iframe scripts and they all have the same result, the iframe just shrinks up to a tiny size. would it be possible to fake the attribute in each page of my site to manually set what size the iframe should change to? I get the impression this is the culprit: contentWindow.document.body.scrollHeight. I know this falls out of the scope of support for this script, but I figured couldn't hurt to ask.