Connecting Tech Pros Worldwide Help | Site Map

Dropdown z-index problem

Bob Ross's Avatar
Member
 
Join Date: Jan 2007
Location: Liverpool
Posts: 119
#1: Sep 21 '07
I am trying to place an object on top of a drop down menu but the drop down always displays at the front in IE6.
Here is my code -

Expand|Select|Wrap|Line Numbers
  1.  <div runat=server align=left style="position:absolute; z-index:1"><asp:DropDownList ID="DropDownList1" runat="server" Width="234px"></asp:DropDownList></div>
  2.                                      <div runat=server align=left style="position:absolute; z-index:100"><asp:TextBox ID="TextBox1" runat="server" Height="108px"></asp:TextBox></div>
*This is simple case to try and work out a solution.
I have been googling and came across this - "Windowed elements such as SELECT and, in earlier browsers, IFRAME are always a higher z-index than other elements, such as DIV."

Does anyone know a way around this at all?
Newbie
 
Join Date: Sep 2007
Posts: 13
#2: Sep 21 '07

re: Dropdown z-index problem


Quote:

Originally Posted by Bob Ross

I am trying to place an object on top of a drop down menu but the drop down always displays at the front in IE6.
Here is my code -

Expand|Select|Wrap|Line Numbers
  1.  <div runat=server align=left style="position:absolute; z-index:1"><asp:DropDownList ID="DropDownList1" runat="server" Width="234px"></asp:DropDownList></div>
  2.                                      <div runat=server align=left style="position:absolute; z-index:100"><asp:TextBox ID="TextBox1" runat="server" Height="108px"></asp:TextBox></div>
*This is simple case to try and work out a solution.
I have been googling and came across this - "Windowed elements such as SELECT and, in earlier browsers, IFRAME are always a higher z-index than other elements, such as DIV."

Does anyone know a way around this at all?

Hi there,

Its a known problem and what i find the best sollution is with Javascript trigger a onmouseover event on what needs to be on top of the dropdown. And then hide the dropdown.

Greetings,

Paul
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,561
#3: Sep 21 '07

re: Dropdown z-index problem


I never remember the solution to this (in css) though I've seen it myself. Play with adding position:relative to some of the elements (I think). You might trying adding your own z-index value.
Reply