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 6912117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:03:05+00:00 2026-05-27T09:03:05+00:00

When the user clicks on a button i show a fancybox that indicates that

  • 0

When the user clicks on a button i show a fancybox that indicates that user should wait till the action is completed:

jQuery(document).ready(function () {
             $.fancybox('Please Wait...',{'modal':true});
        });

now i check the requested action via $.post function and return the result message (either action was successful or the error why the action failed) and now i want to close the first fancybox and show the new fancybox with the response i got from ajax:

$.post('someurl.aspx',{'somethingtopost':'value'},
function(data){
jQuery(document).ready(function () {
$.fancybox(data);
         });
     }
);

The problem is the second fancybox doesn’t show. there are many examples on showing a second fancybox when closing the first one (adding to onClosed attribute) but as in this one I don’t want to show the second fanybox after closing the first one, I want to show it when the action is completed.

  • 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-05-27T09:03:06+00:00Added an answer on May 27, 2026 at 9:03 am

    You can trigger a second Fancybox any time regardless that there is one already opened (and without closing it first). Just try firing a second Fancybox when the action is completed.

    The second Fancybox window (once is triggered) will replace the first one without any further closing command.

    function openFancybox() {
        setTimeout( function() {$('#delayed').trigger('click'); },10000);
    }
    $(document).ready(function() {
        $('#pageLoad').fancybox({
            helpers: {overlay:{opacity: 0.3}}
        }).click();
        openFancybox();
        $('#delayed').fancybox({
            helpers: {overlay:{opacity: 0.3}}
        });
    }); // ready
    

    I set an example page here that starts Fancybox on page load, then it fires a second Fancybox after 10 seconds.

    The first Fancybox closes automatically after the second is fired.

    UPDATE

    Or maybe you would prefer this version

    function openFancybox() {
        setTimeout( function() {$('#delayed').trigger('click'); },10000);
    }
    $(document).ready(function() {
        $('#goProcess').click(function(){
            $.fancybox({
                href: '#wait',
                modal: true,
                helpers: {overlay:{opacity: 0.3}},
                afterLoad: function() {
                    openFancybox();
                }
            }); // fancybox
        });
        $('#delayed').fancybox({
            helpers: {overlay:{opacity: 0.3}}
        });
    }); // ready
    

    Open fancybox on a button click, then triggers a second fancybox after 10 seconds
    (or after a process in the background is completed.)

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

Sidebar

Related Questions

When the user clicks a button, I want to show a popup form that
How can I force validation when user clicks button? One would think this should
When a user clicks on a button or link, I use the SimpleModal jQuery
As soon as the user clicks the delete button my jQuery script asks the
I have a site that downloads a pdf when the user clicks a button.
I show a form using jQuery Fancybox -- in the form, the user has
If the user clicks on a button, I set myVar = true, then show
When the user clicks a button, I want his browser to automatically scroll to
My goal: the user clicks a button. From the button pops up a two-level
In my typical app, the user clicks a button in an aspx page, invokes

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.