1// FAQ Accordion 2// Aynı anda yalnızca bir soru açık kalır. 3 4document.querySelectorAll('.faq-question').forEach((button) => { 5 button.addEventListener('click', () => { 6 const currentItem = button.closest('.faq-item'); 7 const currentAnswer = currentItem.querySelector('.faq-answer'); 8 const isOpen = button.getAttribute('aria-expanded') === 'true'; 9 10 document.querySelectorAll('.faq-item').forEach((item) => { 11 if (item !== currentItem) { 12 const otherButton = item.querySelector('.faq-question'); 13 const otherAnswer = item.querySelector('.faq-answer'); 14 15 otherButton.setAttribute('aria-expanded', 'false'); 16 otherAnswer.hidden = true; 17 } 18 }); 19 20 button.setAttribute('aria-expanded', String(!isOpen)); 21 currentAnswer.hidden = isOpen; 22 }); 23});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.