PageSourceSearch

https://penaviation.com/wp-content/plugins/stm-megamenu/assets/js/megamenu.js?ver=2.3.1

js penaviation.com collected 2026-09-26 07:51:34 UTC 3,548 bytes, 118 lines download raw bytes

1(function ($) {
2    "use strict";
3
4    var onHoverMap = [];
5
6    $(document).ready(function () {
7        stretch_child();
8        setActive();
9        wrapMenuElement();
10
11        var windowW = $(document).width();
12
13        if(windowW < 450) {
14            moveMenuContent();
15        }
16    });
17
18    $(window).on('load', function(){
19        stretch_child();
20    });
21
22    $(window).resize(function(){
23        stretch_child();
24    });
25
26    function moveMenuContent() {}
27
28    function setActive() {
29        $('.stm_menu_child_use_post').each( function () {
30            var stmMenuChild = $(this);
31
32            stmMenuChild.find('.sub-menu li.menu-item').first().addClass('active');
33
34            stmMenuChild.find('.sub-menu li.menu-item').on('mouseover', function () {
35                //$(this).parent().parent().addClass('active');
36                $('.sub-menu li.menu-item').removeClass('active').removeClass('remove_before');
37                $(this).addClass('active').addClass('remove_before');
38            })
39
40            stmMenuChild.find('.sub-menu li.menu-item').on('mouseout', function () {
41                //$(this).parent().parent().removeClass('active');
42                $(this).removeClass('active');
43                $(this).first().addClass('active');
44            })
45        });
46    }
47
48    function wrapMenuElement () {
49        $('.stm_menu_item_has_filter_posts').each( function () {
50
51            var bg = $(this).find('a[data-megabg]').attr('data-megabg');
52
53            var style = '';
54            var hasBg = '';
55            if( typeof(bg) != 'undefined' ) {
56                style = 'style="background-image: url(' + bg + ');"';
57                hasBg = 'stm-mm-has_bg'
58            }
59
60            if($(this).find('.sub-menu').length > 0) {
61                $(this).find('.stm-mm-category-filter-wrap, .sub-menu').wrapAll('<div class="stm-mm-container ' + hasBg + '" ' + style + '></div>');
62            } else {
63                $(this).find('.stm-mm-category-filter-wrap').wrap('<div class="stm-mm-container ' + hasBg + '" ' + style + '></div>');
64            }
65
66        } );
67    }
68
69    function stretch_child() {
70        // Wide
71        var $wide = $('.stm_megamenu__wide > ul.sub-menu');
72        var windowW = $(document).width();
73
74        if ($wide.length) {
75            var $containerWide = $wide.closest('.header_top .container, .top_nav .container');
76            var containerWideW = $containerWide.width();
77
78            // -15 due to global style left 15px
79            var xPos = ((windowW - containerWideW) / 2 ) - 15;
80
81            $wide.each(function () {
82
83                $(this).css({
84                    width: windowW + 'px',
85                    'margin-left': '-' + xPos + 'px'
86                })
87            })
88        }
89
90        // Boxed
91        var $boxed = $('.stm_megamenu__boxed > ul.sub-menu');
92        if ($boxed.length) {
93            var $container = $boxed.closest('.header_top .container, .top_nav .container');
94            var containerW = $container.width();
95
96
97            $boxed.each(function () {
98                $(this).css({
99                    width: containerW + 'px'
100                })
101            })
102        }
103
104
105        /*GET BG*/
106        var $mega_menu = $('.stm_megamenu');
107        $mega_menu.each(function(){
108            var bg = $(this).find('a[data-megabg]').attr('data-megabg');
109            if(typeof bg !== 'undefined') {
110                $(this).find(' > ul.sub-menu').css({
111                    'background-image' : 'url("' + bg + '")'
112                })
113            }
114        })
115    }
116
117
118})(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.