PageSourceSearch

https://jeelex.ru/local/templates/jeelex_v2/components/jeelex/category/faq/script.js

js jeelex.ru collected 2026-09-30 05:32:26 UTC 1,306 bytes, 30 lines download raw bytes

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.