I'm using JQuery
to change opacity of the page after a certain delay. Problem is, my popup heritate this opacity too.
How can I apply it on the entire page without my div #popup-news
?
content.html :
<div id="popup-news">
[...]
</div>
style.css :
#popup-news {
width: 45%;
position: fixed;
left: 50%;
transform: translateX(-50%);
padding-top: 10px;
padding-bottom: 40px;
display: none;
background-color: white;
border: 1px solid #d6d8dc;
z-index: 99;
}
js file :
setTimeout(function(){
$('#popup-news').css('display', 'block');
}, 30000);
if($('#popup-news').css('display') == 'none'){
$('body').css('opacity', '0.2');
}