But I need a slight modification … I need the sub-categories (and 2nd level sub-categories and so on) to have a prefix (–) for the menu to be more readable.
I have managed to get it to work with 1st level sub-categories using this code:
var prefix = (el.parent().hasClass(‘level1’) == true) ? “- ” : “”;
Now I don’t know how to get to work for even deeper categories.
I have uploaded the modification to codepen to make it easier for you guys to get the whole concept. You can find it here: [http://codepen.io/anon/pen/rlfhq](http://codepen.io/anon/pen/rlfhq “http://codepen.io/anon/pen/rlfhq”)