Files
aifo-portal-web/js/partnership.js
T
2026-07-03 20:34:27 +08:00

35 lines
880 B
JavaScript

/**
* Partnership page — FAQ accordion (Figma export style).
*/
(function () {
function initFaq(root) {
if (!root) return;
root.querySelectorAll(".partnership-faq__header").forEach(function (header) {
header.addEventListener("click", function () {
var item = header.closest(".partnership-faq__item");
if (!item) return;
var isOpen = item.classList.contains("is-open");
root.querySelectorAll(".partnership-faq__item").forEach(function (el) {
el.classList.remove("is-open");
});
if (!isOpen) {
item.classList.add("is-open");
}
});
});
}
function init() {
initFaq(document.querySelector("#partnership-page .partnership-faq"));
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", init);
} else {
init();
}
})();