Skip to content Skip to sidebar Skip to footer

JQuery Hide ULs And Only Expand Once Particular Class Set (bit Like An Accordion)

Right folks, After battling with a JQuery Accordion trying to do what I want I think hiding all secondary UL's and only expanding them once a class my CMS sets automatically on lis

Solution 1:

It's simple. You need to do it the other way around. Find the element that has the class "currentbranch1" and traverse up to the "multilevel-linkul-0" parent and tell that to slide down.

Code

//How to target this command to multilevel-linkul-0 class?
$(function(){
      $('.currentbranch1').parents('ul.multilevel-linkul-0').slideDown();
});

Here is an example of Fiddle.


Post a Comment for "JQuery Hide ULs And Only Expand Once Particular Class Set (bit Like An Accordion)"