views:

103

answers:

1

Hey there you lot, is there a way that I can open a lightbox (in this case iBox) from within an IFRAME and have the actual lightbox open in the Parent page?

sigh I am confusing myself here!

+2  A: 

Only if you have control of the parent page too. If so you could either invoke methods directly using parent.foo() if on the same domain, or using e.g easyXDM if on different domains.

Either way, you will have to load the correct scripts and css on the parent to do so.

Sean Kinsey
So if my link to the iBox is: <a href="#save-to-book" rel="iBox" class="recipe-links" target="_parent">Save to Cookbook</a>, then how would I insert the parent.foo()?Currently the actual iBox is appearing within the IFRAME :'(
Neurofluxation
You will have to manually call a method in the parent window, and in the parent have code that manually invokes the lightbox.
Sean Kinsey
Sorry for being completely n00bish - How would I call a method for the PARENT page from the IFRAME'd page?
Neurofluxation
`parent.foo()` - parent is a reference to the iframes parent element. foo is the name of a function declared in the parents global scope.
Sean Kinsey