Opening a second fancybox Within another fancybox!

Anders picture Anders · May 4, 2011 · Viewed 19.7k times · Source

Hey! I'm having trouble with my fancyboxes!

I am launching a form within a fancybox. Normally, its opened by fancybox in a iframe mode (since it's being launched as a widget from other domains). Within this iframe, i am opening a second fancybox to display validation errors. All this - works good.

But, if a user visists the url to the form - i need the form to be displayed within a fancybox thats calling the form with type:inline. This is where the second fancybox fails, instead of popping out, over the parent fancybox, it replaces it - and my form disappears.

So... how do i launch multiple instances of fancybox?

Answer

Rafael picture Rafael · May 4, 2011

The bad news is, fancybox is a single-instance script. On page load it creates all overlay DIVs. All links and other elements bound with fancybox will just re-use these overlays. Making fancybox handle multiple instances would require a more or less bigger overwrite of the script.