Solved

Combobox ignores z-index

Posted on 2002-04-25
8
258 Views
Last Modified: 2012-08-14
I have a page that uses a floating navigation menu that I pop open and close to configure a few of the parameters that affect the display.  I have things like # of rows, date range and the like.  Everything works beautifully except that comboboxes on the main page bleed thru to my floating menu.

My floating menu is similar to this example
http://builder.cnet.com/webbuilding/0-7690-8-6958380-1.html?tag=st.bl.3882.dir1.7690-8-6958380-1

It seems that no matter what I do with the z-index, the combo ignores it and just pushes right up to the top.

<span id='staticcombo' style='position:absolute;left:0;top:0;visibility:hidden' z-index=10>

Anyone see this behavior before and no how to make the combos behave?

Many Thanks, Alan
0
Comment
Question by:alanjacks
8 Comments
 
LVL 19

Accepted Solution

by:
webwoman earned 100 total points
ID: 6969389
That's they way they work. Form elements have a z-index of infinity. You can't put anything behind them.

The only way around it is to hide the ENTIRE form on mouseover. You can't hide just a piece of it, that causes a multitude of problems and isn't cross browser compatible.

Of course, when the form is hidden it's really hidden -- you can't do anything to it, like update values, or script it in any way. Not reliably, anyhow. You can script the DIV it is in, but not the form itself, while it's hidden.
0
 

Author Comment

by:alanjacks
ID: 6969428
The strange part is that only comboboxes bleed thru.  Input fields, check boxes, text areas all behave well by hiding when my div overlays them.  The combos are the only controls that won't allow an overlay.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6969446
ww is correct.  The select has a virtual z-index of infinity, which can not be modified.

The options are: Hide it as suggested;  move it out of the way; or redesigne the page to eliminate the positioning conflict.  It is that way by design, and there is nothing that can change the behaviour.

Cd&
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 33

Expert Comment

by:knightEknight
ID: 6969451
wwwwoman is correct ... SELECTs are compound-objects, and as such they have been assigned a z-index of infinity and so nothing can be placed on top of them.  The other form elements you mentioned (textbox, checkbox, etc) are not compound objects and so you can change their z-index, or give another element (like a menu) a higher z-index.
0
 

Author Comment

by:alanjacks
ID: 6969454
The strange part is that only comboboxes bleed thru.  Input fields, check boxes, text areas all behave well by hiding when my div overlays them.  The combos are the only controls that won't allow an overlay.
0
 

Author Comment

by:alanjacks
ID: 6969463
The strange part is that only comboboxes bleed thru.  Input fields, check boxes, text areas all behave well by hiding when my div overlays them.  The combos are the only controls that won't allow an overlay.
0
 

Author Comment

by:alanjacks
ID: 6969473
Well, boo for select boxes.

Thanks for the info everyone.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6969482
Actually in some older browsers all the form elements show through.

Cd&
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question