Collapse all other accordion items when one is expanded
问题 I have an accordion menu that works nicely. But now, I want only one parent item expanded at a time. In other words, when I click to expand one parent item, any other expanded parent item needs to collapse. I thought adding a line to slide the sibling elements up would work, but either that's not it, or I'm doing it wrong. Any ideas? Here is my jsfiddle Here is my code: CSS a { cursor: pointer; } .menu ul { list-style: none outside none; } .menu li a { line-height: 25px; } .menu > ul > li > a