duimstra Posted October 27, 2010 Share Posted October 27, 2010 Hi!I already modified my category-tree-branch.tpl to show the class="selected" on LI elements instead of A elements.When one of my primary navigation options is selected, it works great. But when I select a child (secondary navigation level), the class="selected" appears only on the child LI and disappears from parent LI.QUESTION: How can I echo class="selected" on parent element also?Thanks! Link to comment Share on other sites More sharing options...
duimstra Posted October 28, 2010 Author Share Posted October 28, 2010 A quick and dirty solution for my problem: $().ready(function() { if($('#main-nav ul li ul li.active').length > 0) { $('#main-nav ul li ul li.active').parent().parent().addClass('active'); } }); Works for me, at the moment. I'd still rather see a solution with PHP since not everybody has JavaScript.. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now