WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Autoresize cross-domain only from small to large height?

[Resolved] Autoresize cross-domain only from small to large height?

  • Hi Michael,

    First, you did and still do a great job with this plugin! Thank you!

    Second, is it true that the autoresize for cross-domains only works to enlarge the height of the parent and not to shorten it? Unless you reload that parentpage again…

    My dummy-site you can find on http://www.edwinkonings.nl/test/, where the parent indeed is resizing the iframe from 1500px to 3000px and even to 5000px, but then back to 1500px the parent stays the same as to 5000px.

    Regards,
    Edwin

    http://wordpress.org/extend/plugins/advanced-iframe/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author mdempfle
    Participant

    @mdempfle

    o.k. can you add some debug in the ai.js?

    function aiResizeIframeHeightById(id, nHeight)
    should be called from the remote Javascript.

    Please add an
    alert(height);

    right after
    height = parseInt(nHeight) + aiExtraSpace;

    and check if the height is the one which is expected.

    The the other thing is: when/how is the size changed? you have the event for resize on the onload event. So when the page is made smaller by Javascript the resize is not called.

    Thank you for your quick reply!
    I just added the debug to ai.js and I see that the height remains on 5122.

    Plugin Author mdempfle
    Participant

    @mdempfle

    o.k. Then it seems setting the body of the page to 1 does not work (this does work on the parent javscript).

    I would have to rebuild this scenario on my local system.
    The solution I have on the parent is to actually resize the iframe – measure the scroll height and then set the height.

    In your case you can measure the height of the div and use this for measuring…

    Plugin Author mdempfle
    Participant

    @mdempfle

    I tried to reproduce it.

    But I could not. If I use the same
    updateIframeHeight()
    as you do it work for me. Can you send me your setup?

    On my test setup it is resized smaller as well.

    I’m currently working on a solution where you only have to include a javascript and the iframe and everything else is created automatically.

    Plugin Author mdempfle
    Participant

    @mdempfle

    I can now reproduce it. I tested on my local host with the normal resize active which does of course work.

    The problem is the body that expands automatically.
    I play around now with an extra div which is measured.
    This works on my local test already but I have to check on all browsers now…

    Plugin Author mdempfle
    Participant

    @mdempfle

    Hi,

    I have a working solution now. Do you want to test it?

    Sorry, this weekend I was not able to reply…
    Yes, I would like tot test it! 🙂

    Plugin Author mdempfle
    Participant

    @mdempfle

    Please try this version:

    http://www.tinywebgallery.com/test/advanced-iframe-3.5.zip

    Please read the updated instructions in the file. Save the configuration once to get the the generated js file in the js folder.

    This is what I did so far without the desired results:

    In wp-admin I deactivated and removed the plugin advanced-iframe 3.4.3. Then I uploaded the zip-file advanced-iframe 3.5 and I activated the plugin. I checked the “var domain=” in ai_external.js and that was OK.

    From each of the iframed files I removed the line before the </body>-tag:
    <iframe id="hiddenIframe" style="visibility:hidden;" width="0" height="0" src="http://www.edwinkonings.nl/test/wp-content/plugins/advanced-iframe/js/iframe_height.html">Iframes not supported.</iframe>.

    Also I also removed the call onload="updateIframeHeight()" in the <body>-tag.

    and I added between the <head> and </head>:
    <script>http://www.edwinkonings.nl/test/wp-content/plugins/advanced-iframe/js/ai_external.js</script>

    Then uploaded the iframed files and cleared the cache and reloaded the parent. What did I do wrong?

    I don’t see the hidden iframe in the iframed pages with firebug.

    Plugin Author mdempfle
    Participant

    @mdempfle

    My mistake…

    <script src=”http://www.edwinkonings.nl/test/wp-content/plugins/advanced-iframe/js/ai_external.js”></script>

    is the way how to include the script.
    And the best way for scripts is to add them before the </body> if not really needed before. This speeds up page loading.

    Plugin Author mdempfle
    Participant

    @mdempfle

    My mistake…

    <script src=”http://www.edwinkonings.nl/test/wp-content/plugins/advanced-iframe/js/ai_external.js”></script>

    is the way how to include the script.
    And the best way for scripts is to add them before the </body> if not really needed before. This speeds up page loading.

    OK, now it’s working the way I want it to!
    Thank you for your help!

    Edwin

    Plugin Author mdempfle
    Participant

    @mdempfle

    😉 – and hopefully much easier to configure.

    Please also test on your target pages as well. Because I do modify the html now and please check if this causes any issue n your pages.

    Even automatically scroll to the top is much easier to configure: you only have to select YES in the admin panel under Advanced iframe – Advanced options -> Javascript iframe onload options -> Scrolls the parent window to the top!

    Plugin Author mdempfle
    Participant

    @mdempfle

    Really? I have to check if this is really allowed on all browsers.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Resolved] Autoresize cross-domain only from small to large height?’ is closed to new replies.