From 74d0523c69d211cbbeabd17aadd708b3356ef5ef Mon Sep 17 00:00:00 2001 From: Alexander Zaytsev <36922661+GolwerShoden@users.noreply.github.com> Date: Fri, 5 Jun 2026 11:24:47 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=8B=D1=82=D0=B0=D1=8E=D1=81=D1=8C=20?= =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=D0=B0=D0=BD=D1=83=D1=82=D1=8C=20=D1=80?= =?UTF-8?q?=D0=B0=D1=81=D0=BA=D1=80=D1=82=D1=8B=D0=B8=D0=B5=20=D0=B2=D0=BE?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D1=81=D0=B0=20=D0=BF=D0=BE=20=D0=B4=D1=80?= =?UTF-8?q?=D0=B5=D1=81=D1=81=D0=BA=D0=BE=D0=B4=D1=83=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BC=D0=BE=D0=B1=D0=B8=D0=BB=D0=BA=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/burka_wed/script.js | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/services/burka_wed/script.js b/services/burka_wed/script.js index 0a820f2..741f326 100644 --- a/services/burka_wed/script.js +++ b/services/burka_wed/script.js @@ -599,16 +599,6 @@ window.addEventListener('scroll', () => { // ---- FAQ: аккордеон ---- -function setFaqAnswerHeight(answer, open) { - if (open) { - answer.classList.add('open'); - answer.style.maxHeight = answer.scrollHeight + 'px'; - } else { - answer.classList.remove('open'); - answer.style.maxHeight = '0px'; - } -} - document.querySelectorAll('.faq-question').forEach(btn => { btn.addEventListener('click', () => { const expanded = btn.getAttribute('aria-expanded') === 'true'; @@ -616,21 +606,12 @@ document.querySelectorAll('.faq-question').forEach(btn => { document.querySelectorAll('.faq-question').forEach(b => { b.setAttribute('aria-expanded', 'false'); - setFaqAnswerHeight(b.nextElementSibling, false); + b.nextElementSibling.classList.remove('open'); }); if (!expanded) { btn.setAttribute('aria-expanded', 'true'); - setFaqAnswerHeight(answer, true); - } - }); -}); - -window.addEventListener('resize', () => { - document.querySelectorAll('.faq-question[aria-expanded="true"]').forEach(btn => { - const answer = btn.nextElementSibling; - if (answer.classList.contains('open')) { - answer.style.maxHeight = answer.scrollHeight + 'px'; + answer.classList.add('open'); } }); });