Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify depth of navigation #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LRotherfield
Copy link

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:

$(".navigation_one > ul").tinyNav({
  active: 'current',
  depth: 2
});

@bigsweater
Copy link

+1

Nicely done.

@ghost
Copy link

ghost commented Apr 4, 2013

There's a bug with the implementation, please see #39

@magmanoid
Copy link

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; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants