PageSourceSearch

https://xn----9sbksaxebw1i0b.xn--p1ai/mg-templates/mg-elegant/comp…/menu-categories.js?rev=1706173451

js xn----9sbksaxebw1i0b.xn--p1ai collected 2026-09-26 12:29:37 UTC 1,046 bytes, 20 lines download raw bytes

1// Открывающемуся блоку присваивается класс _active, который необходимо прописать в css для отображения меню при клике на кнопку;
2
3const menuCategories = document.querySelector('.js-menu-categories'); // Блок выезжающего меню
4const buttonCategories = document.querySelector('.js-button-categories'); // Кнопка, по которой открывается меню
5const elemsClose = document.querySelectorAll('.js-close-elem'); // Все элементы, по которым закрывается меню
6
7buttonCategories.addEventListener('click', () => {
8    menuCategories.classList.toggle('_active');
9});
10
11for (let elemClose of elemsClose) {
12    elemClose.addEventListener('click', () => {
13        menuCategories.classList.remove('_active');
14    });
15}
16
17$('.js-categories-arrow').click(function() {
18    $(this).toggleClass('_active');
19    $(this).closest('li').children('.js-categories-slidetoggle').slideToggle();
20});

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.