PageSourceSearch

https://www.hauntedhappenings.org/wp-content/themes/hauntedhappenings/js/mega-menu.js?ver=1.5.1

js hauntedhappenings.org collected 2026-10-02 05:50:21 UTC 2,260 bytes, 67 lines download raw bytes

1(function ($, root, undefined) {
2    $(function () {
3        'use strict';
4
5        let megaMenu = $('#mega-menu');
6        const $body = $('body');
7
8        const toggleBodyScroll = function (disableScroll) {
9            $body.toggleClass('mega-menu-open', disableScroll);
10            $body.css('overflow', disableScroll ? 'hidden' : '');
11        };
12
13        //// Close Mega Menu
14        $('button#close-mega').on('click', function (e) {
15            megaMenu.fadeOut();
16            $('.hamburger').removeClass('close');
17            toggleBodyScroll(false);
18        });
19
20        $('.hamburger, .mega-menu-button').on('click', function (e) {
21            megaMenu.fadeIn();
22            toggleBodyScroll(true);
23        });
24
25        //// Mega Menu Slider
26        let slideZindex = 2;
27        let slides = $('.mega-slide');
28        let activeSlide = null;
29        $('#mega-nav li').on('mouseenter', function () {
30            let id = $(this).attr('id').replace('menu-item-', '');
31            let slide = $(`.mega-slide[data-id="${id}"]`);
32
33            if (!slide.length || slide[0] === activeSlide?.[0]) return;
34
35            if (activeSlide) {
36                activeSlide.css('opacity', 0);
37            }
38
39            slide.css({
40                'z-index': slideZindex++,
41                'opacity': 1,
42            });
43
44            activeSlide = slide;
45        });
46
47        //// Toggle Mega Menu Sub menu
48        $('.mega-menu-toggle').on('click', function (e) {
49            // e.preventDefault();
50
51            const $button = $(this);
52            const $parent = $button.closest('.menu-item-has-children');
53            const $submenu = $parent.children('.sub-menu');
54            const isOpen = $button.attr('aria-expanded') === 'true';
55
56            $('.menu-item-has-children').not($parent).removeClass('is-open').children('.sub-menu').stop(true, true).slideUp(250);
57
58            $('.mega-menu-toggle').not($button).attr('aria-expanded', 'false').attr('aria-label', 'Expand submenu');
59
60            $button.attr('aria-expanded', !isOpen);
61            $button.attr('aria-label', isOpen ? 'Expand submenu' : 'Collapse submenu');
62
63            $parent.toggleClass('is-open');
64            $submenu.stop(true, true).slideToggle(250);
65        });
66    });
67})(jQuery, this);

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.