如何在关闭jQuery手风琴菜单时折叠所有子菜单 [英] How to collapse all submenus on closing jQuery accordion menu

查看:221
本文介绍了如何在关闭jQuery手风琴菜单时折叠所有子菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我之前曾问过

I have previously asked this question. The solution provided by Ahs N worked great. But now when the menu is closed and opened again, the sub-items that were previously opened are still open in whatever configuration they were left. How do I clear this state but still retain the effects of the excellent solution I am using?

推荐答案

这是我所做的,并且似乎可以根据您的要求进行工作:

This is what I did and seems to work according to what you asked:

if(name=="H3"){
      $(target).next().show().find("p, div").show();
}

此处是 CodePen

这篇关于如何在关闭jQuery手风琴菜单时折叠所有子菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆