JS Behaviors Test Page

1 — Nav (yg-nav.js)


1a — Simple dropdown (panel anchors to its parent wrapper)


1b — Mega menu (same data-yg-dropdown, panel anchors to the nav bar)

The only structural difference: position: relative is on the <nav>, not the <li>. So .mega-panel { left: 0; width: 100% } spans the full nav width.


✓ Click one dropdown → others close. ✓ Click outside → closes. ✓ Escape → closes. ✓ Same data-yg-dropdown attribute for both patterns.

2 — Accordion (yg-accordion.js)


✓ Single-open mode: opening one closes others. ✓ Keyboard accessible.

3 — Lightbox (yg-lightbox.js)


✓ Click any image to open. ✓ Arrow buttons + keyboard arrows to navigate. ✓ Escape or click outside to close. ✓ Swipe on touch.

4 — Carousel (yg-carousel.js)


✓ Autoplay pauses on hover/focus. ✓ Prev/next buttons. ✓ Dot indicators. ✓ Keyboard arrows. ✓ Touch swipe.