I have a page with a dhtml menu and a dropdownlist. It turns out that the menu always gets rendered behind the ddl no matter what I put in its z-index. How can i change the z-index or whatever i have to change in the dropdownlist so it renders the way i want
it? I want the ddl to be behind the menu, not the other way around. Thanx.
josephbui is right, the select tags in IE are rendered after everything else so they appear on top of layers regardless of the z-index. I don't know how to fix it myself, but it is possible. Check out some menu components like aspnetmenu and coalesys' webmenu.
They are both able to make DHTML menus appear in front of select boxes (sometimes they make the select box disappear entirely when the menu is active).
I guess my point was that there is a way that it can be done since they did it. I didn't mean to imply that you have to go an purchase one of those :) Unfortunately I don't know of any way to do it... sorry.
For an IE client browser: put the SELECT tag within a DIV tag. When the menu is supposed to be on top, set DIV tag's style's visibility="hidden" and when the SELECT is supposed to be on top set the visibility="visible".
<div id="DropDownDIV"></div>
<div id="MenuDIV" style="position:relative;top:-20px" onmouseover="HideMenu()" onmouseout="ShowMenu()">This is the menu</div>
<script language="javascript">
function HideMenu()
{
document.all["DropDownDIV"].style.visibility = "hidden";
}
function HideMenu()
{
document.all["DropDownDIV"].style.visibility = "visible";
}
</script>
You can make the positioning absolute
if you want. I have no idea if this works in any other browsers, but having seen DynAPI (look it up on sourceforge), I know it is possible to do it. They will have free open source cross browser code there which you can use.
oepirobo
Member
365 Points
73 Posts
Z-index of DropDownList
Sep 04, 2003 04:59 PM|LINK
Sergio Florez M.
josephbui
Member
250 Points
50 Posts
Re: Z-index of DropDownList
Sep 04, 2003 06:21 PM|LINK
dot365
Contributor
2520 Points
504 Posts
Re: Z-index of DropDownList
Sep 04, 2003 07:51 PM|LINK
oepirobo
Member
365 Points
73 Posts
Re: Z-index of DropDownList
Sep 04, 2003 10:18 PM|LINK
Sergio Florez M.
dot365
Contributor
2520 Points
504 Posts
Re: Z-index of DropDownList
Sep 05, 2003 05:27 PM|LINK
josephbui
Member
250 Points
50 Posts
Re: Z-index of DropDownList
Sep 05, 2003 05:35 PM|LINK
<div id="DropDownDIV"></div> <div id="MenuDIV" style="position:relative;top:-20px" onmouseover="HideMenu()" onmouseout="ShowMenu()">This is the menu</div> <script language="javascript"> function HideMenu() { document.all["DropDownDIV"].style.visibility = "hidden"; } function HideMenu() { document.all["DropDownDIV"].style.visibility = "visible"; } </script>You can make the positioning absolute if you want. I have no idea if this works in any other browsers, but having seen DynAPI (look it up on sourceforge), I know it is possible to do it. They will have free open source cross browser code there which you can use.Bill2clone
Star
9975 Points
1995 Posts
Re: Z-index of DropDownList
Sep 09, 2003 04:16 PM|LINK
Tressleworks modules
DNN & webhosting
IEWCtrls
leabre
Member
700 Points
140 Posts
Re: Z-index of DropDownList
Sep 10, 2003 09:54 PM|LINK