Kinnectus
Kinnectus

Reputation: 899

Colorbox inside iFrame - Close from parent

I am working on a project where I am simply loading same directory content into an iFrame. No external pages.

I have Colorbox within the iFrame content which is working beautifully.

My question is: I have some "parent" buttons which I would like to make them close any of the iFrame Colorbox popups. The project is an "information point" system with some buttons in the parent that show at all times, but whenever I click the buttons the iFrame Colorbox stays open.

A lot of the pages I have found talk from the opposite way, controlling the parent from within a Colorbox iFrame...

I'm going to guess that this may not be achievable from a security point of view...

many thanks everyone :)

Upvotes: 1

Views: 540

Answers (2)

Kinnectus
Kinnectus

Reputation: 899

I ended up using jQuery the other way round so the child controls the parent and hides the parent controls and when the ColorBox control is closed it "shows" the parent controls.

Upvotes: 0

Jack
Jack

Reputation: 9538

You might be able to do something like this:

$('.cboxIframe')[0].contentWindow().$.colorbox.close();

Upvotes: 1

Related Questions