Click here to Skip to main content
13,195,710 members (54,522 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hey guys, I have a smaall issue that maybe you could help me with. I have a web application and on the screens if the a dropdown list is selected and if you hover over a menu item the dropdown list is displayed through the menu item. I tried setting the Z-Index of the dropdown to -1 and the z-index of the menu item to 1 but no luck. Thanks for your help guys.
Posted 8-Nov-12 22:14pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try hiding all the dropdowns whenever onmouseover event occurs on the menu item. Similarly, unhide the dropdowns whenever onmouseout event occurs.

code would be something like below -
function toggleDropdown(action) { 
// action is boolean variable
// true : hide dropdown (call on mouseover)
// false: show dropdown (call on mouseout)
var dropdowns = document.getElementsByTagName('select');
var cssText = action ? 'none' : '';
for(i = 0; i < dropdowns.length; i++) {
  dropdowns[i].style.display = cssText;

Hope this may help you out...

Niral Soni
Mickt1985 9-Nov-12 7:32am
Yeah cool makes sense, il implement this when I get a chance and accept your solution, thanks for your help.
Mickt1985 9-Nov-12 10:40am
Hey I had a chance to test this out and it is not hiding the dropdown on mouse out, any other ideas?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171019.1 | Last Updated 9 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100