Sindbad~EG File Manager
window.addEventListener("load", () => {
const faqItems = document.querySelectorAll(".single-article__faq-item");
faqItems.forEach((item) => {
item.addEventListener("click", () => {
const answer = item.querySelector(".single-article__faq-answer");
item.classList.toggle("active");
// Max height of the answer
const maxHeight = answer.scrollHeight;
// If the answer is open
if (answer.style.maxHeight) {
// Close the answer
answer.style.maxHeight = null;
} else {
// Open the answer
answer.style.maxHeight = maxHeight + "px";
}
});
});
});
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists