PageSourceSearch

https://www.contracosta.edu/wp-content/themes/radicati4/styles/50-parts/header/_header-menu.js?ver=6.9.5

js contracosta.edu collected 2026-09-24 09:39:43 UTC 2,538 bytes, 75 lines download raw bytes

1document.addEventListener('DOMContentLoaded', function() {
2    const submenuToggles = document.querySelectorAll('.submenu-toggle');
3
4    submenuToggles.forEach(toggle => {
5        toggle.addEventListener('click', function(event) {
6            event.preventDefault();
7            const parentItem = this.parentElement;
8            const submenu = parentItem.querySelector('.sub-menu');
9            const isExpanded = this.getAttribute('aria-expanded') === 'true';
10
11            // Toggle the submenu visibility
12            if (submenu) {
13                submenu.style.display = isExpanded ? 'none' : 'block';
14                this.setAttribute('aria-expanded', !isExpanded);
15            }
16
17            // Toggle the open class
18            parentItem.classList.toggle('open');
19        });
20    });
21});
22
23
24/*
25(function($) {
26    $(document).ready(function() {
27        var $menuToggle = $('.menu-open-toggle');
28        var $menuPanel = $('.menu-panel');
29        var $firstFocusableElement = $menuPanel.find('a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])').first();
30
31        $menuToggle.click(function() {
32            $menuPanel.toggleClass('menu-panel--open');
33            $('body').toggleClass('no-scroll');
34
35            if ($menuPanel.hasClass('menu-panel--open')) {
36                $firstFocusableElement.focus();
37            } else {
38                $menuToggle.focus();
39            }
40        });
41    });
42})(jQuery);*/
43
44
45(function($) {
46    $(document).ready(function() {
47        var $menuToggle = $('.menu-open-toggle');
48        var $menuPanel = $('.menu-panel');
49        var $firstFocusableElement = $menuPanel.find('a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])').first();
50
51        function closeMenu() {
52            $menuPanel.removeClass('menu-panel--open');
53            $('body').removeClass('no-scroll');
54            $menuToggle.focus();
55        }
56
57        $menuToggle.click(function() {
58            $menuPanel.toggleClass('menu-panel--open');
59            $('body').toggleClass('no-scroll');
60
61            if ($menuPanel.hasClass('menu-panel--open')) {
62                $firstFocusableElement.focus();
63            } else {
64                $menuToggle.focus();
65            }
66        });
67
68        // Close with Escape
69        $(document).on('keydown', function(e) {
70            if (e.key === 'Escape' && $menuPanel.hasClass('menu-panel--open')) {
71                closeMenu();
72            }
73        });
74    });
75})(jQuery);

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.