WordPress.org

Support

Support » Plugins and Hacks » Easy FancyBox » [Resolved] close from child window and resize

[Resolved] close from child window and resize

  • Hi.

    Is there any way to close the fancybox iframed window from the child one?

    Is the any way to resize the window from the child?

    I have tried a few ways, but no chance.

    $.fn.fancybox.close();
    window.parent.$.fancybox.close();
    parent.jQuery.fn.fancybox.close();
    $.fancybox.resize();

    Thnx for your help

Viewing 1 replies (of 1 total)
  • Plugin Author RavanH

    @ravanh

    In theory, the javascript code parent.$.fancybox.close(); called from the iframe content should cause FancyBox to close, similarly with parent.$.fancybox.resize(); but … this is not true in all cases!

    For example, if the iframe content is a web page from another domain (other website) this will not work. The call is intercepted and blocked to prevent a real world security issue called “cross-site scripting”.

    Is your iframe content pulled from another domain than the domain of the original page from where you open FancyBox?

    If so, there might still be a way: create a file in your site root called crossdomain.xml filled with:

    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
        <site-control permitted-cross-domain-policies="all"/>
        <allow-access-from domain="*.the-other-domain.com" />
    </cross-domain-policy>

    Where you replace the text *.the-other-domain.com with that other domain name. The * is a wild-card to allow a wider scope of sub-domains (including www) for example, but can also be used on its own to allow access for ALL domains out there. But be warned, allowing cross domain access to sites you do not trust, DOES bring along a security issue! Read/search on Google for more…

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] close from child window and resize’ is closed to new replies.
Skip to toolbar