krackmoe
krackmoe

Reputation: 1763

open fancybox over another fancybox ajax

I have a Fancybox which shows me some dialog and a button to click. When i click this button i want to open another fancybox over the existing one.. or on another position on the screen, but i dont want to lose the already existing fancybox. I want to fill both of them by an ajax request.. Is this possible? Because what i tried resulted in losing the original fancybox..

I got this code:

$.fancybox.showActivity();
                $.ajax({
                    type        : "POST",
                    cache       : false,
                    url     : "../testservlet?select=1,
                    data        : $(this).serializeArray(),
                    height      : 600,
                    width       : 800,
                    padding     : 30,
                    showCloseButton : true,
                    success     : function(data) {
                        $.fancybox(data);
                    }
                });

$.fancybox.showActivity();
                $.ajax({
                    type        : "POST",
                    cache       : false,
                    url     : "test?select=2,
                    data        : $(this).serializeArray(),
                    padding     : 30,
                    showCloseButton : true,
                    success     : function(data) {
                        $.fancybox(data);
                    }
                }); 

Upvotes: 1

Views: 7456

Answers (2)

Chandrasen Singh
Chandrasen Singh

Reputation: 93

Open first fancybox in iframe. Then inside that another fancybox can be open.

Upvotes: 1

JFK
JFK

Reputation: 41143

Unfortunately you cannot have more than a single fancybox at the same time ... it has been designed like that.

You could have another fancybox inside of the existing one though (when open an external page -via iframe- with fancybox in it) ...or you could open that inner fancybox on the parent page, creating the illusion that you have two fancyboxes on the same page. Check here for more

On the other hand, the only lightbox I remember that supports multiple boxes is jQuery Tools Overlay

Upvotes: 2

Related Questions