Display and center fancybox on the parent page instead of the child iframe

Your Account / Forums / Easy FancyBox Pro / Display and center fancybox on the parent page instead of the child iframe

  • Author
    Posts
    • July 29, 2019 at 9:56 am #15599

      I am using FancyBox on a child page of an iFrame (see this link https://mdc2020.reconnaissance-dev.com/sponsors-iframe/ ) When I try to open the FancyBox from the parent page https://mdc2020.reconnaissance-dev.com/sponsors/ the overlay and the centring of Fancybox is in relation to the child page. I would like to have the overlay and the centring as the parent page.

      At the moment this is all on the same site but once in production, I will have a resource site with all the different child iframe pages which will be used on 10 different conference site as this is for sponsor pages.

      Through some google searches it seems to be possible but my Javascript knowledge is basically none existent.
      http://www.picssel.com/playground/jquery/fancyboxFromIframe_16Jan12.html

      Not sure if you can help with this?
      Thanks,
      Phil

    • July 29, 2019 at 9:56 am #15617

      Hi Philippe, there is one crucial condition for opening a light box on the parent frame: both parent and child frame must live on the same domain. If not, the script will be blocked by any browser that respects cross-site scripting security.

      Next, it’s important to realize that this is not possible with the standard WordPress plugin. It would either need a heavy modification or (better) a custom implementation of the light box script on the child page.

      I’m afraid this is out of the scope of possibilities of Easy FancyBox…

    • July 29, 2019 at 9:56 am #15618

      Hi Ravan,

      Thanks for your feedback, it is what I thought. I am currently moving away from iFrame and looking at HTML Includes.

  • You must be logged in to reply to this topic.