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.
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.
I hope this helps.