PageSourceSearch

https://www.naturhistoriskmuseum.dk/Files/Templates/Designs/standard_responsiv/includes/nav/meanmenu/script.js

js naturhistoriskmuseum.dk collected 2026-10-02 10:49:22 UTC 3,065 bytes, 117 lines download raw bytes

1(function($) {
2
3
4  $.fn.menumaker = function(options) {
5      
6      var cssmenu = $(this), settings = $.extend({
7        title: "Menu",
8        format: "dropdown",
9        sticky: false
10      }, options);
11
12      return this.each(function() {
13                    
14        cssmenu.prepend('<div id="menu-button">' + settings.title + '</div>');
15        //$(".globe-mobile").insertBefore($(".house-mobile"));
16        $(this).find("#menu-button").on('click', function(){
17          $(this).toggleClass('menu-opened');
18          var mainmenu = $(this).next('ul');
19          if (mainmenu.hasClass('open')) { 
20            mainmenu.hide().removeClass('open');
21          }
22          else {
23            mainmenu.show().addClass('open');
24            if (settings.format === "dropdown") {
25              mainmenu.find('ul').show();
26            }
27          }
28        });
29
30/* removed to hide subclasses MBK */
31/*
32        cssmenu.find('li ul').parent().addClass('has-sub');
33
34        multiTg = function() {
35          cssmenu.find(".has-sub").prepend('<span class="submenu-button"></span>');
36          cssmenu.find('.submenu-button').on('click', function() {
37            $(this).toggleClass('submenu-opened');
38            if ($(this).siblings('ul').hasClass('open')) {
39              $(this).siblings('ul').removeClass('open').hide();
40            }
41            else {
42              $(this).siblings('ul').addClass('open').show();
43            }
44          });
45        };
46
47        if (settings.format === 'multitoggle') multiTg();
48        else cssmenu.addClass('dropdown');
49      
50*/
51        if (settings.sticky === true) cssmenu.css('position', 'fixed');
52
53        resizeFix = function() {
54          if ($( window ).width() > 768) {
55            cssmenu.find('ul').show();
56          }
57
58          if ($(window).width() <= 768) {
59            cssmenu.find('ul').hide().removeClass('open');
60
61          }
62        };
63        resizeFix();
64        return $(window).on('resize', resizeFix);
65
66      });
67  };
68})(jQuery);
69
70(function($){
71$(document).ready(function(){
72
73$(document).ready(function() {
74  $("#cssmenu").menumaker({
75    title: "Menu",
76    format: "multitoggle"
77  });
78
79
80var foundActive = false;
81
82$("#cssmenu > ul > li").each(function() {
83  if ($(this).hasClass('active')) {
84    activeElement = $(this);
85    foundActive = true;
86  }
87});
88
89if (foundActive === false) {
90  activeElement = $("#cssmenu > ul > li").first();
91}
92
93defaultWidth = lineWidth = activeElement.width();
94
95defaultPosition = linePosition = activeElement.position().left;
96/*
97menuLine.css("width", lineWidth);
98menuLine.css("left", linePosition);
99
100*/
101$("#cssmenu > ul > li").hover(function() {
102  activeElement = $(this);
103  lineWidth = activeElement.width();
104  linePosition = activeElement.position().left;
105  // menuLine.css("width", lineWidth);
106  // menuLine.css("left", linePosition);
107}, 
108function() {
109 // menuLine.css("left", defaultPosition);
110 // menuLine.css("width", defaultWidth);
111});
112
113});
114
115
116});
117})(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.