Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET CSS
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 23:14pm
frostcox2.3K

1 solution

Rate this: bad
good
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...
 
Regards,
Niral Soni
  Permalink  
Comments
Mickt1985 at 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 at 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
0 OriginalGriff 7,130
1 DamithSL 5,089
2 Maciej Los 4,866
3 Sergey Alexandrovich Kryukov 4,647
4 Kornfeld Eliyahu Peter 4,409


Advertise | Privacy | Mobile
Web03 | 2.8.141223.1 | Last Updated 9 Nov 2012
Copyright © CodeProject, 1999-2014
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