Answer the question
In order to leave comments, you need to log in
How to set different background dimming colors for different modal windows in fansybox?
I use fansybox for modals.
There are 2 different modal windows on the page. When opening one overlay should be black, when opening the second, white.
There is a wrapCSS option, but it only affects the window itself, not the overlay.
How to be?
UPD: The problem is solved, but maybe. is there a more elegant solution?
Answer the question
In order to leave comments, you need to log in
The problem is solved in the following way.
$(document).ready(function() {
$(".to-modal").fancybox({
fitToView : false
});
$(".to-modal--emp").fancybox({
fitToView : false,
'beforeLoad' : function(){
$('body').addClass('white');
},
'afterClose': function() {
$('body').removeClass('white');
}
});
});
.white{
.fancybox-overlay {
background: url('../img/design/overlay--white.png');
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question