1

I have created a multilevel drop-down menu. There is a problem when I try to get height of the element at level 2, but level 1 is working correctly. Why?

jsFiddle

alert($('ul.sub-1').outerHeight()); // --> 240
alert($('ul.sub-2').outerHeight()); // --> 0
Jordan Gray
  • 15,876
  • 3
  • 50
  • 66

1 Answers1

1

you need to use visibility instead of display. see updated fiddle

ul.sub-menu {
position: absolute;
visibility: hidden;

li:hover > .sub-menu {
visibility: visible; 
}
MilkyTech
  • 1,861
  • 2
  • 14
  • 35