Add a fixed overlay, which is hidden by default and is displayed when you need it. You can either add this to your HTML structure yourself, or use jQuery to add it. Personally, I would add it to the HTML structure.
The .overlay element should have a z-index lower than #welcome , but larger than any other elements that it should span:
.overlay { background-color: #000; bottom: 0; display: none; left: 0; opacity: 0.5; filter: alpha(opacity = 50); position: fixed; right: 0; top: 0; z-index: 99; }
Updated jquery to add / show overlay div:
//add overlay if it does not exist if( $('.overlay').length == 0 ){ $('body').append('<div class="overlay"></div>'); } if ($.cookie('20120129') != '1') { $('.overlay').show(); $('#welcome').slideDown('slow'); $.cookie('20120129', '1', { expires: 20 }); }
source share