I am working with a grid of accordions presented like this:
<body>
<div>
<div class='accordion-left'>
<h3>Left 1</h3>
<div></div>
</div>
<div class='accordion-right'>
<h3>Right 1</h3>
<div></div>
</div>
</div>
<div>
<div class="accordion-left">
<h3>Left 2</h3>
<div></div>
</div>
<div class="accordion-right">
<h3>Right 2</h3>
<div></div>
</div>
</div>
</body>
In addition, there is a link to a jsfiddle showcasing the same.
When I click on "Left 1," based on how they are structured in HTML, I expected both "Left 2" and "Right 2" to expand together. However, that's not what happens as they end up misaligned. A similar issue arises when clicking "Right 1," resulting in only "Right 2" expanding. Ideally, if sibling divs have varying heights, I would want all matching bottom divs to drop down according to the tallest one.
Is there a way to treat these accordion div groups as a single entity?