JQuery hide ULs and only expand once particular class set (bit like an accordion)

后端 未结 1 1063
借酒劲吻你
借酒劲吻你 2021-01-26 06:56

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 automati

相关标签:
1条回答
  • 2021-01-26 07:29

    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.

    0 讨论(0)
提交回复
热议问题