views:

1286

answers:

2

Well i have a transparent div or the background is set to transparent :) css:

#lowerLayer
{
    position: fixed;
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
    width: 100%;
    height: 100%;
    background-color: Transparent;
    cursor: help;
    z-index: 1;
}

The div is placed right under the tag.. and under there i have a blueprint layout.

jquery(this is run in $(document).ready):

$("#lowerLayer").click(function() {
    $(this).fadeTo("fast", 0, function() {
        $(this).hide(0);
    });
});

My layout works perfect in Opera 10 and i guess it works in Opera 9 to... but IE 7 bugs layers that have lower z-index are acting as they are above the transparent div...

+1  A: 

A simple solution would be to place the transparent div (#lowerLayer) last in the html (just before the closing </body>.

It's a known issue with some browsers (IE for example)

EDIT: as mentioned in my comment, the blockUI plugin handles everything you may ever need if you want to mask your page with an overlay.

Philippe Leybaert
well it was worth a try but it did not help :( +1
Petoj
When the transparent div has the highest z-index, and it is last in the HTML, it will always be above anything else on the page (with the exception of dropdown lists on IE, which is a bug). A better option would be to use the blockUI plugin (I've added the link in my answer)
Philippe Leybaert
A: 

I have tested In my Ie7 , and this JS & css work well !!

Alexander Corotchi
try placing some div tags with lower z-index and add a onclick event on that div...
Petoj
for example My HTML and CSSCSS #lowerLayer{ position: fixed; top: 0px; left: 0px; right: 0px; bottom: 0px; width: 100%; height: 100%; background-color: Transparent; cursor: help; z-index: 2;}.secondDiv{ z-index:1; position:relative;}---------------------HTML---------------<div id="lowerLayer">bla bla bla</div> <div class="secondDiv" >bla bla bla</div>
Alexander Corotchi
I put for #lowerLayer (z-index:2;), but for second div (z-index:1; position:relative;)
Alexander Corotchi