cferdinandi / tabby

Lightweight, accessible vanilla JS toggle tabs.
MIT License
602 stars 73 forks source link

Can i create multible tabs and use hash url to navigate? #59

Closed dimensi closed 8 years ago

dimensi commented 8 years ago

Can i create multible tabs and use hash url to navigate? Hello, sorry for my english. I can use a hash url, to navigate through multiple tabs at once? For example I have 3 categories, and each category has sub-item. Each category is a tab. Each item is a tab. How do I get there using hash url in point 5 of the second category

cferdinandi commented 8 years ago

Out-of-the-box, Tabby does not support nested tabs (nor do I think this is necessarily a good approach for your users).

You can probably hack something together using the Tabby API instead of running tabby.init(), but I haven't tried it myself. Thinking about this out loud, you would want to:

  1. Remove the active class from all categories and items.
  2. Find the item whose ID matches the hash.
  3. Find the category that item belongs to.
  4. Add the active class to the item and category.

You're almost rewriting a custom script at that point, which you may be better off doing instead of trying to make Tabby fit your use case.