You-Dont-Need-JavaScript icon indicating copy to clipboard operation
You-Dont-Need-JavaScript copied to clipboard

Accordion demo isn't a true accordion

Open Tyler-H opened this issue 8 years ago • 4 comments

In an accordion menu, only one "section" opens at a time (this mimics the musical instrument which stretches open one part the bellows at a time). In your demo, opening a second or third section does not close the previously-opened section.

Tyler-H avatar Jul 05 '16 15:07 Tyler-H

I found a demo in #15, it's awesome

NamPNQ avatar Jul 05 '16 16:07 NamPNQ

Not ideal, since you have to have at least one item open at all times in that demo

Tyler-H avatar Jul 09 '16 14:07 Tyler-H

The bellows of an accordion open and close all parts at the same time. This reduces wear on one part should the player not fully open and close them.

ShirtlessKirk avatar Jul 11 '16 11:07 ShirtlessKirk

I feel like we've got two separate issues: 1) designing for simplicity, and 2) avoiding Javascript.

JS is necessary in certain cases, but if the goal is to avoid it at all costs, these alternatives need not be perfect or true replacements for JS capabilities. However, if they increase complexity, it seems foolhardy to shun JS at all costs.

As mentioned in #14, there needs to be some clarification for scenarios that are not worth using CSS or JS. I'm playing around with personal web stuff and just want enough styling to change background colors and make text look nice. A few animations or other tricks from this project will be fun, so I appreciate having this resource.

I'd like to minimize my usage of javascript because I don't want to invest a lot of time learning it, and I don't want to make a website that needs a lot of code to function. It's like alcohol -- too much, and you get a headache. That goes for js or css, and for a personal blog, you really don't need much of anything...

ghost avatar Aug 13 '16 20:08 ghost