Skip to content Skip to sidebar Skip to footer

Can An Iframe Pop Up A Lightbox-style Box?

This question isn't about popping up an iframe inside a Lightbox; rather, it's about an iframe on a page that can launch its own Lightbox-style box in the page that contains that i

Solution 1:

It is not possible for the <iframe> to interact with its parent frame if the two frames are on different domains.

Solution 2:

If both sites belong to the same domain you can add the JS of the lightbox to the main frame and call the function inside the iframe using ´parent.function´

Solution 3:

Try looking at fancybox. I know that supports iframes, and I always use it over Lightbox, much more customisable. I am pretty sure it can deal with nested iframes, however I could be wrong. Worth a try nether the less.

Can display images, HTML elements, SWF movies, Iframes and also Ajax requests

There are examples on the bottom of the page: http://fancybox.net/

Solution 4:

I don't know if it's around anywhere online, but i saw Facebook give a presentation about injecting an iframe into other sites to circumvent such problems with cross-site issues. Worth a look.

Solution 5:

It is possible but only if you can have some controll of the remote server. There are various ways to do that but to gice you a quick start you can use this simple frame postman.

When you recieve a message from the frame (probably with image URL) you simply open a lightbox dialog in your main document.

Post a Comment for "Can An Iframe Pop Up A Lightbox-style Box?"