1"use scrict" 2 3document.addEventListener("DOMContentLoaded", () => { 4 document.querySelectorAll(".js-faq").forEach((button) => { 5 button.addEventListener("click", function () { 6 const faqItem = this.closest(".faqs__item") 7 const body = faqItem.querySelector(".faqs__body") 8 9 // ÐеÑеклÑÑаем клаÑÑ active на кнопке 10 this.classList.toggle("active") 11 12 if (body.classList.contains("active")) { 13 // СвоÑаÑиваем 14 body.style.maxHeight = "0px" 15 body.classList.remove("active") 16 } else { 17 // РаÑкÑÑваем: ÑнаÑала ÑбÑаÑÑваем max-height, ÑÑÐ¾Ð±Ñ Ð¸Ð·Ð¼ÐµÑиÑÑ scrollHeight 18 body.style.maxHeight = "none" 19 const height = body.scrollHeight + "px" 20 // ÐозвÑаÑаем max-height в 0, ÑÑÐ¾Ð±Ñ Ð·Ð°Ð¿ÑÑÑиÑÑ Ð°Ð½Ð¸Ð¼Ð°ÑÐ¸Ñ 21 body.style.maxHeight = "0px" 22 // ÐеболÑÑÐ°Ñ Ð·Ð°Ð´ÐµÑжка Ð´Ð»Ñ Ð¸Ð½Ð¸ÑиализаÑии transition 23 setTimeout(() => { 24 body.style.maxHeight = height 25 body.classList.add("active") 26 }, 10) 27 } 28 }) 29 }) 30})
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.