How to collapse all submenus on closing jQuery accordion menu

北城以北 提交于 2019-12-12 01:26:26

问题


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?


回答1:


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

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

Here is the link to the CodePen



来源:https://stackoverflow.com/questions/31909296/how-to-collapse-all-submenus-on-closing-jquery-accordion-menu

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