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 22:14pm
Mickt19852.2K

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 310
1 Sergey Alexandrovich Kryukov 176
2 PhilLenoir 164
3 Richard MacCutchan 160
4 Sharmanuj 146
0 Sergey Alexandrovich Kryukov 6,077
1 OriginalGriff 5,115
2 CPallini 2,473
3 Richard MacCutchan 1,597
4 Abhinav S 1,505


Advertise | Privacy | Mobile
Web02 | 2.8.140814.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