Open LRotherfield opened 11 years ago
+1
Nicely done.
There's a bug with the implementation, please see #39
I would recomend to do it by update a library on line 40
Change:
options += '<option value="' + $(this).attr('href') + '">';
To:
options += '<option value="' + $(this).attr('href') + '" class="menuLevel-'+ $(this).parents('ul, ol').length +'">';
Then all options have own class with level specification: class="menuLevel-1" class="menuLevel-2" class="menuLevel-3"
And you can easy hide them in css:
.menuLevel-3{ display:hide; }
I have been working on a project that has a mega menu and also a side menu. Because of the duplicate navigation I only wanted the top navigation to show the first level of nav once its made into a select. The alterations in this pull request add another settings key "depth" which allows the developer to set a specific depth to iterate to.
An example: