jQuery accordion - how to collapse other open accordion panes when another one is opened
问题 I have an accordion that I want to have the following functionality: when the user clicks on a link to expand, the other expanded links (if any) will collapse. I know this functionality is built in the accordion plugin, but I'm trying to avoid adding another library (jQuery UI). EDIT: Here is the code I have right now (here it is on jsFiddle: http://jsfiddle.net/s2Jfs/2/): $('.accordion-toggler').addClass('toggle-plus'); $('.accordion-toggler').click(function() { $this = $(this); if($this