Toggling children visibility in jQuery accordion-style menu

I have a simple accordion-style menu which opens/closes its children with a help of jQuery: [jsFiddle]( If I click on menu items everything works fine - children of selected items are displayed, while all other unnecessary children items hide. However, I'd like to be able to open menu tree based on some variable passed (`id`). So, in this jsFiddle I created manual links (on right side) which should show corresponding item in menu (expand all parents) and hide all others. I managed to toggle only first-level children when clicked on manual links, but when I click on let's say 4th-level link (cat 11 in my example), nothing happens. What I'd like to do is to expand all parents of selected item and collapse all other which are not in selected child's the tree path. Thanks for helping.

以上就是Toggling children visibility in jQuery accordion-style menu的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准