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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:43:36+00:00 2026-05-23T11:43:36+00:00

I have a simple problem with 2 overlays. One overlay is triggered from (and

  • 0

I have a simple problem with 2 overlays. One overlay is triggered from (and by) the other overlay. As only one overlay can be active at any one time, correctly so, overlay number 1 that triggered 2 closes. However, it takes the mask with it and hence overlay 2 appears without the mask. How can I switch between 2 overlays without the mask disappearing?

The code, overlay 1

$("button[rel*=busy]").overlay({     

    api: true , 
    mask: {
        maskId: 'defaultMask' ,
        color: null
    },
    effect: 'apple',

    onLoad: function() {

        $.post( 'ajax_file_here.php' ,
            { var: something } ,
            function( data ){                

                if( data.status == 'confirm' ) {

                    confirmOverlay();

                } else {

                    errorOverlay();

                }              

            } ,
            'json' );

    } ,
    closeOnClick: false ,
    closeOnEsc: false ,
    close: '.noClose'       

});

And overlay 2

var errOverlayObject = $('#error_overlay').overlay({

    api: true,      
    mask: {
        maskId: 'defaultMask' ,
        color: null
    },
    effect: "apple"

});

function errorOverlay() {

    errOverlayObject.load();

}

As you can see there is also a confirm version of the second overlay, but that works identical to the error one.

  • 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-23T11:43:37+00:00Added an answer on May 23, 2026 at 11:43 am

    I hope you do not mind but I created my own simplified example. Hopefully you will be able to adapt this to your situation.

    There is a little bit of flicker between the dialogue boxes (due to the animation effect) but the mask stays in place. I imagine you could remove the flickering by adjusting the animation effect settings – I suspect you could do something in the overlay’s onBeforeLoad method but I’m not exactly sure what.

    <!DOCTYPE html>
    <html>
    <head>
        <title>Chained Modals</title>
        <script src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script>
        <style>
        .modal {
            background-color:#fff;
            display:none;
            width:350px;
            padding:15px;
            text-align:left;
            border:2px solid #333;
    
            opacity:0.8;
            -moz-border-radius:6px;
            -webkit-border-radius:6px;
            -moz-box-shadow: 0 0 50px #ccc;
            -webkit-box-shadow: 0 0 50px #ccc;
        }
        </style>
    </head>
    <body>
    <p>
        <button class="modalInput" rel="#box1">Stage 1</button>
    </p>
    <div class="modal" id="box1">
        <h2>Stage 1 dialogue</h2>
        <p>
            You can only interact with elements that are inside this dialog.
            To close it click a button or use the ESC key.
        </p>
        <button class="modalInput" rel="#box2">Stage 2</button>
    </div>
    <div class="modal" id="box2">
        <h2>Stage 2 dialogue</h2>
        <p>
            You can only interact with elements that are inside this dialog.
            To close it click a button or use the ESC key.
        </p>
        <button class="modalInput" rel="#box3">Stage 3</button>
    </div>
    <div class="modal" id="box3">
        <h2>Stage 3 dialogue</h2>
        <p>
            You can only interact with elements that are inside this dialog.
            To close it click a button or use the ESC key.
        </p>
        <button class="close">End</button>
    </div>
    <script>
    
    $(window).load(function() {
    var msk;
    
    var triggers = $(".modalInput").overlay({
        mask: {
            color: '#ebecff',
            loadSpeed: 200,
            opacity: 0.9,
            onClose: function() {
                var id = this.getExposed().attr('id');
                if(id == 'box1'|| id == 'box2'){
                   var nextId;
                   if(id == 'box1'){
                      nextId = '#box2';
                   }
                   if(id == 'box2'){
                      nextId = '#box3';
                   }
                   msk = this.getMask();
                   msk.css('display','block');
                   $(nextId).css('z-index', '9999');
                }
            }
        },
        closeOnClick: false,
        onBeforeLoad: function(){
            var id = this.getOverlay().attr('id');
            if(id == 'box2'|| id == 'box3'){
                   // need to put something here to avoid flicker
                   //
               // this.getConf().mask.startOpacity = 0.8; 
            }
        }
    });
    
    });
    </script>
    </body>
    </html>
    

    I hope this helps.

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

Sidebar

Related Questions

I have a simple problem but no matter what I try I can't see
I'm encountering the following problem - I have simple GWT overlay types, and I'm
I have a simple problem but I haven't had any luck finding the solution
I have a simple problem, but can't come with a simple solution :) Let's
I have a simple problem when querying the SQL Server 2005 database. I have
i have very simple problem. I need to create model, that represent element of
I have a simple problem that i cannot solve. I have a dictionary: aa
I have a simple problem but I am not sure how to solve it.
I have a very simple problem which requires a very quick and simple solution
I have a very simple problem and a solution that will work, but I'm

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.