VPenkov / okayNav

The world's okayest responsive navigation. This is (sort of) a legacy implementation. Please stay tuned to the 3.0 branch (https://github.com/VPenkov/okayNav/tree/v3.0)
4.02k stars 267 forks source link

Error if nav is between two blocks #48

Open throrin19 opened 8 years ago

throrin19 commented 8 years ago

I, I try to set my navbar expandable and responsive with okaynav but i have a big problem.

I Have My List Like this :

+------------+----------------------------------+-------------------+
|            |                                  |                   |
|   Logo     |      OkayNav                     |     Other Button  |
|            |                                  |                   |
+------------+----------------------------------+-------------------+

But after try this, The result is :

+------------+------------------------------------------------------+
|            |                                                      |
|   Logo     |      OkayNav                         Other Button    |
|            |                                                      |
+------------+------------------------------------------------------+

The Okaynav part don't care about the other block in the right. How to fix this ?

throrin19 commented 8 years ago

Okay I find my problem. The list is created with jQuery so, I call the recalcNav.

But, in my case, the calcul is not correct and the default_width is wrong because it's not updated. So, I add this line after all calcul vars in recalcNav Function and it works fine :

self.default_width = self.getChildrenWidth(self.navigation);

I set this in pull request