Drop down menu and dropdownlist control problem

H

ha_shaikh

In our web application(ASP.Net), we have database driven menus that are
of dropdown style on getting focus (a requirement). We've used
Javascript Menu Object for creating these menus. On different pages of
the application, we are using ASP.Net some DropDownLists. Now the
problem is that when any menu drops, these dropdownlists disappear as
long as the menu is dropped and reappear when the menu is folded back.
We are unable to find any reason and any solution for this. Can
somebody help us out of this?

Thanks in advance.
 
K

Karl Seguin

Ha:
Hopefully you'll be glad to know this is really a common problem. First
off, i want you to understand that this is a "feature". Let me explain why.

a select is a windowed control and doesn't participate in the normal
z-indexing. So, without this "fix" when your menus drop, if they dropped
over a select, the select would appear on top of it. here's a simple
example you can look at:
<html><body>
<div style="background:#aaa;border:1px solid #000;"
onMouseOver="this.style.position = 'absolute';this.style.height =
'300px';">Mouse Over Me</div>
<select></select>
</body>
</html>

In IE (in firefox it'll run fine), the select will "bleed" or be seen
through the div, no matter what z-index you do or anything.

To get around this, many menu controls use some simple javascript. Whenever
a menu drops, get all the <SELECT>'s on the page and make them invisible
(whihc you can do in like 3 lines of code). It's a pretty brute force
method, but for a while it was the only way. So now you know :)

Recently a new method has come to light to solve the problem, involvnig
iframes. you can read up more on it here:
http://dotnetjunkies.com/WebLog/jking/archive/2003/07/21/488.aspx

The menues in ASP.Net 2.0 will use this feature (it's still a hack, but
atleast it gets the job done).

Karl
 
H

ha_shaikh

Thankyou so much for you reply and clearing me the problem. Now I can
understand the problem but the issue is that it doesn't look good in a
professional web application. Also, I have seen some websites developed
in ASP.Net and having dropdown menu but the drop down lists neither
disappear nor go behind the menu. Anyways I'll check if this iFrame
solution works in my application or not.
Thanks once again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,815
Latest member
treekmostly22

Latest Threads

Top