Skip to content

176 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.

fix: keep the pressed Accordion question under the pointer

matin8a8c59cda8b0
diff --git a/animations/04-micro-interactions/accordion/index.html b/animations/04-micro-interactions/accordion/index.html
index 03ccba58..cf21f595 100644
--- a/animations/04-micro-interactions/accordion/index.html
+++ b/animations/04-micro-interactions/accordion/index.html
@@ -25,7 +25,8 @@
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
/* The stage scrolls: open answers can make the list taller than it */
.stage{display:flex;align-items:flex-start;justify-content:center;padding:clamp(12px,3vw,24px);overflow:auto;background:#0b0b0d}
- .acc-list{width:100%;max-width:420px;margin:auto;display:flex;flex-direction:column;gap:4px}
+ /* The list sits at the top of the stage: with auto margins above and below it, it would re-centre every time an answer opens, and the pressed question would slide away from under the pointer */
+ .acc-list{width:100%;max-width:420px;margin:0 auto;display:flex;flex-direction:column;gap:4px}
/* Accordion item */
.acc-item{background:var(--ui-bg);border:1px solid var(--ui-border);border-radius:6px;overflow:hidden;transition:border-color .15s}
.acc-item.open{border-color:rgba(255,157,92,.35)}