Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8077787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:34:52+00:00 2026-06-05T15:34:52+00:00

Using Fancybox version 2 supplied by http://fancyapps.com/fancybox/#support I want to open a fancybox from

  • 0

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 fancybox can be called. But when that 2nd fancy box is closed. Rather than simply closing(pressing X in the corner or by pressing Esc) it I want it to reopen the first fancybox. How do I do this?

Thank you – I have searched the internet for an answer but found answers regarding my query applying to previous versions of fancybox not the new version (2.0)…

My code is below:

Main Page-

<!DOCTYPE html>
<head>
    <!-- Add jQuery library -->
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>

    <!-- Add fancyBox main JS and CSS files -->
    <script type="text/javascript" src="./source/jquery.fancybox.js"></script>
    <link rel="stylesheet" type="text/css" href="./source/jquery.fancybox.css" media="screen" />

    <script type="text/javascript">
        $(document).ready(function() {
            /*
                Simple image gallery. Uses default settings
            */

            $('.fancybox').fancybox();

            /*
                Different effects
            */

            // Change title type, overlay opening speed and opacity
            $(".fancybox-effects-a").fancybox({
                helpers: {
                    title : {
                        type : 'outside'
                    },
                    overlay : {
                        speedIn : 500,
                        opacity : 0.95
                    }
                }
            });


            /*
                Thumbnail helper. Disable animations, hide close button, arrows and slide to next gallery item if clicked
            */

            $('.fancybox-thumbs').fancybox({
                prevEffect : 'none',
                nextEffect : 'none',

                closeBtn  : false,
                arrows    : false,
                nextClick : true,

                helpers : { 
                    thumbs : {
                        width  : 50,
                        height : 50
                    }
                }
            });
});
</script>
    <a href="1stFancyBox.html" class="fancybox fancybox.ajax">1st Fancy Box</a>
</html>

1stFancyBox.html –

<html>
<a href="2ndFancyBox.html" class="fancybox fancybox.ajax">2nd FancyBox</a>
</html>

2ndFancyBox.html –

<html>
<body>
Hellloooooooooo</body>
</html>

Thanks 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:34:55+00:00Added an answer on June 5, 2026 at 3:34 pm

    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

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im using fancybox from: http://fancyapps.com/fancybox/ And the scroll pane is not working correctly and
so I'm using fancybox, as well as Google's minify http://code.google.com/p/minify/ but then after minifying
I am using fancyapps.com 's FancyBox and I was wondering how to call a
I'm using Fancybox ( http://fancybox.net ) to pop open an iFrame. In order to
I'm using FancyBox jquery plugin to display modal popup boxes. The site is: http://www.chatisfying.com
I am using jquery fancybox version 2.0.3. I want to prevent close on click
I'm using Fancybox from FancyApps to preview content on my website. <a href=#inline class=various><span
I'm using Fancybox to open a number of links from a menu and I
I'm using FancyBox on my page, and occasionally (but not always), the lightbox opens
I am using Fancybox (fancyapps.com) to use popup ajax windows. I need to place

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.