I haven't got a unique problem, but for the life of me I can't figure out what I'm doing wrong.
I have a page that has a series of sections. Part of the section is a little image. When the image is clicked, I want to show a custom control. Showing the control is trivial, set the z-index a bit higher to ensure the control is on top of everything.
But the user can still interact with the sections behind the control.
To stop that, I added a "blanket". Basically a div that is the size of the document with the following CSS (in jQuery syntax) -
{
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: $(document).height(),
display: 'none',
zIndex: 1,
backgroundColor: '#FF0000'
};
Yeah...the background is red so I can see it for testing. I set opacity to 0.1 (light blur). I then set the z-index of my custom control to 2 so that it is on top of the blanket.
This works perfectly in FireFox, Chrome, and Safari, but not in IE.
The custom control is not a child of the blanket.
The goal is to have the following document covered by blanket with control on top of blanket to interact with it. This is what I get on all browsers except IE. On ie...it goes document with control and both are covered by the blanket.
Answer
scunliffe was the closest (answered in a comment I can't link to). The custom control is inside of a relatively positioned div (several down actually). the blanket was simply appended onto the end of the body. Therefore it was outside the relatively positioned div and started it's own z-index stack (as documented here). Since IE 6/7 are broken in this regard, no matter what I set the z-index to, it would always be below the blanket.
So I moved the blanket to be the first child inside the relatively positioned div. This isn't 100% complete yet because if you scroll (which I can't stop with this solution), the blanket div is only the height of the visible content. I now have to figure out how to get the complete height of the content (visible and non-visible).