javascript - Fixing dynamic responsive navigation when there are more items than the container has width -


so i'm working dynamic navigation. basic html markup of <ul><li> composition. problem occurs when user added many items navigation , there isn't enough room them within container (imagine simple <div>).

so, need solution. wondering if there way determine when width of <ul> larger or equal containing <div>'s width, inject remaining <li> elements new <li> dropdown them all. possible , if how?

i know basics of jquery i'm afraid i'm not sure on this. oh and, need work responsively need work percentages too.

let me know if feasible or if have better way around this, thanks.

update: have updated github repo plan outlined.

--

i use jquery this. idea i'm having follows.

you <div>'s width, add widths of <li>'s , see if bigger. take off many needed <li>'s fit <div>.

then add ones took off new <li> <ul> dropdown.

i'm happy write this, wont till later when finish work.

i have responsive nav on github, doesn't after, sounds update, once i've written i'll add github version. https://github.com/martinblackburn/responsive-nav


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -