responsive-nav.js icon indicating copy to clipboard operation
responsive-nav.js copied to clipboard

Navigation height with nested <ul>

Open diplopito opened this issue 7 years ago • 2 comments

When using nested

    for submenus (like ul li ul li ... /li /ul /li /ul), the _calcHeight function (629) fails to calculate the correct height. One possible solution would be to use an ID for the navigation container and iterate through the children. In the meantime setting an initial value bigger than zero for savedHeight (634) fixes the issue.

diplopito avatar Mar 27 '17 08:03 diplopito

I've tried setting the initial value of the 'savedHeight' (634) to 1 and 10 and that unfortunately hasn't fixed it. It just adds what ever value I change it to on to the small height that it calculates.

I then tried changing my nested ul and li tags to divs and that didn't fix the issue either

The weird thing is, is that the height calculation works fine on some mobile devices (my iPhone 6) but not others.

benbennybenben avatar Apr 07 '17 16:04 benbennybenben

The value is in pixels: 1 and 10 seem to be very low values, In my case I had to use '30' to add 2 missing lines. I also tried with Iphone and without the fix it would skip lines.

diplopito avatar Apr 08 '17 00:04 diplopito