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
  • 16,306
  • 3
  • 53
  • 69

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,919
  • 2
  • 15
  • 39