Using Fancybox version 2 supplied by http://fancyapps.com/fancybox/#support
I want to open a fancybox from my main page, but within that 1st fancy box a second fancy
You could create two scripts, one for each link
so in the main
page you have:
<a href="1stFancyBox.html" class="fancybox1 fancybox.ajax">1st Fancy Box</a>
Notice that class is now fancybox1
... then the script tha fires the first fancybox.
$(".fancybox1").fancybox();
Inside 1stFancyBox.html
you can have this link
<a href="2ndFancyBox.html" class="fancybox2 fancybox.ajax">2nd FancyBox</a>
Notice that class is now fancybox2
Also in the main
page add the script that fires the second fancybox (from within the first fancybox):
$(".fancybox2").fancybox({
afterClose: function(){
$(".fancybox1").trigger("click");
}
});
The script above will fire the first fancybox after closing the second fancybox regardless the content of 2ndFancyBox.html
.
UPDATE: I added a DEMO here