I created a kind of modal overlay, and then overlay content. The modal overlay has a set of opacity and it works, but the contents of the overlay also have opacity. I think it will inherit it ... I donโt know, t really want to apply a new class to the content, is there any way to say only in relation to
here is my css
.modal-overlay {
position: fixed;
z-index:100;
top: 0px;
left: 0px;
height: 100%;
width: 100%;
background: #000000;
display: none;
}
and my jquery to create model and content
var overlayLayer = $("<div id='office-location'></div>").addClass('modal-overlay');
$('body').append(overlayLayer);
$('<div id="content-for-overlay" style="background-color: white;"></div>').appendTo(overlayLayer);
this.render({ to: "content-for-overlay", partial: "office-location-modal" });
$("body").css("overflow", "hidden");
$('#office-location').css("opacity", 0.8).fadeIn(150);
$('#content-for-overlay').css("opacity", 1);
source
share