0
votes

I have searched thoroughly for this issue on this site and google for many hours and although I cam quite resourceful I can not find a solution to this issue, if this can be done at all, so any help in the right direction would really cool!

I have a window (main page) and a link, this opens a fancybox (iframe) within that window there is another link to open another fancybox (iframe) but I don't want a 'frame in a frame', looks silly, how can I close the first frame and keep the child open?

There are several links on the 'main page' that will need to do this, so having urls in the script will not work (well)

Here's what I mean... www.kamgar.nl

This link is in the main page and will open a fancybox...

<a href="/about" class="pop_up" title="About">About</a>

This link is in the child (above) and I need this to open (in new fancybox) and close the parent (above)

<a href="/message" class="message" title="Message">Message</a>

And the script...

$(document).ready(function() {
$(".pop_up").fancybox({
    maxWidth    : 700,
    maxHeight   : 1000,
    fitToView   : false,
    afterLoad   : function () { $("#content, #page").fadeOut(100); },
    afterClose  : function () { $("#content, #page").fadeIn(10); },
    width       : '50%',
    height      : '80%',
    autoSize    : false,
    closeClick  : false,
    openEffect  : 'fade',
    closeEffect : 'fade',
    scrollOutside: false,
    padding     : '5',
    hideLoading : true,
    title       : false,
    nextClick   : false,
    type        : 'iframe',
    helpers     : { title : { type : 'over'} }
});
});


 $(document).ready(function() {
$(".message").fancybox({
    maxWidth    : 500,
    fitToView   : false,
    afterLoad   : function () { $("#content, #page").fadeOut(100); },
    afterClose  : function () { $("#content, #page").fadeIn(10); },
    width       : '90%',
    height      : 600,
    autoSize    : false,
    closeClick  : false,
    openEffect  : 'fade',
    closeEffect : 'fade',
    padding     : '5',
    modal       : false,
    hideLoading : true,
    title       : false,
    nextClick   : false,
    type        : 'iframe',
    helpers     : { title : { type : 'over'} }
});
});
1
it looks good to me, unless I am not fully understanding the questionJFK

1 Answers

0
votes

I have found out since that this is not possible to do, but I found a way around it by triggering a hidden link to open the page that is being opened.

Confusing I know, but basically the page is being called twice rather than once: Once for the page then the page open again via Fancybox within itself via a hidden link.

If you go to my site I think you'll understand.