responsive-nav.js
responsive-nav.js copied to clipboard
Navigation height with nested <ul>
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.
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.
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.