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

Deadly 提交于 2019-12-02 09:28:14

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!