Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

zIndex problems with IE 5.5 ?

Status
Not open for further replies.

toolkit

Programmer
Aug 5, 2001
771
0
0
GB
Hi there,

For IE: I am creating a little popup window using a div, and want to ensure this is displayed in front of any elements on the page. I have a little code like:

Code:
function showCaption() {

    // code to create text for the caption

    div.style.zIndex = 10;  // arbitrary large zIndex number
    div.style.visibility = "";
}

function hideCaption() {
    div.style.visibility = "hidden";
}

When the code is added to a form with <SELECT> elements, these elements always seem to appear with a higher stacking order than the div, so the caption appears with a 'hole' in it through which the <SELECT> element can be seen....

Anyone know if this is a 'feature' of IE, and if so is there a workaraound?

Thanks for any information. Cheers, NEIL

 
An example of the problem:

problem.gif


I have even tried:

Code:
div.style.zIndex = Number.MAX_VALUE;

But to no avail.

Thanks for any suggestions, NEIL
 
Thanks tuz

What a pain :-(

Cheers, NEIL
 
Actually, it mentions one workaround, which is to hide each element. Sounds like the way to go, something like:

Code:
selects = document.getElementsByTagName( 'select' );
...
function showCaption() {
    for( var s = 0; s < selects.length; s++ )
        selects[s].style.visibility = &quot;hidden&quot;;
    div.style.visibility = &quot;&quot;;
}

function hideCaption() {
    for( var s = 0; s < selects.length; s++ )
        selects[s].style.visibility = &quot;&quot;;
    div.style.visibility = &quot;hidden&quot;;
}

I'm going to have a go ;-)

Cheers. NEIL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top