PageSourceSearch

https://hydroterra.com.au/wp-content/themes/hydroterra_live/scripts/menu.js?ver=1.1.7

js hydroterra.com.au collected 2026-09-29 23:21:29 UTC 4,161 bytes, 137 lines download raw bytes

1jQuery(document).ready(function ($) {
2	var hoverTimeout; // Variable to store the timeout for delaying hover off event
3	var megaMenuList = [];
4	var activeElement;
5	var width_val = $(window).width();
6
7	$(".mega-menu").each(function () {
8		var value = $(this).attr("class").split(/\s+/);
9		$.each(value, function (index, item) {
10			megaMenuList.push(item);
11		});
12	});
13
14	if (width_val > 855) {
15		// Hover functionality for top nav and child menus
16		$(".menu-item").hover(
17			function () {
18				clearTimeout(hoverTimeout); // Clear the timeout when hovering over a new element
19				var classList = $(this).attr("class").split(/\s+/);
20				$(".menu-show").removeClass("menu-show");
21				$.each(classList, function (key, item) {
22					var index = $.inArray(item, megaMenuList);
23					if (index != -1) {
24						$(".mega-menu." + item).addClass("menu-show"); // Show mega menu
25						activeElement = item;
26						return false;
27					}
28				});
29			},
30			function () {
31				// Delay hiding the menu
32				hoverTimeout = setTimeout(function () {
33					$(".mega-menu").removeClass("menu-show"); // Hide mega menu when hover out
34				}, 200); // Set delay to 200ms (adjustable)
35			}
36		);
37
38		// Hover functionality for child menus
39		$(".menu-item-has-children").hover(
40			function () {
41				$(this).children("ul.sub-menu").stop(true, true).slideDown(200); // Show child items
42			},
43			function () {
44				$(this).children("ul.sub-menu").stop(true, true).slideUp(200); // Hide child items
45			}
46		);
47
48		// Hover functionality for sub-child menus
49		$(".sub-menu .menu-item-has-children").hover(
50			function () {
51				$(this).children("ul.sub-sub-menu").stop(true, true).slideDown(200); // Show sub-child items
52			},
53			function () {
54				$(this).children("ul.sub-sub-menu").stop(true, true).slideUp(200); // Hide sub-child items
55			}
56		);
57	} else {
58		/*$(".menu-item.product-menu").click(function (e) {
59			e.preventDefault();
60		});
61
62		$(".menu-item.service-menu").click(function (e) {
63			e.preventDefault();
64		});
65
66		$(".menu-item.support-menu").click(function (e) {
67			e.preventDefault();
68		});
69
70		$(".menu-item:not(.menu-item-has-children)").click(function () {
71			if ($(this).hasClass("active-megamenu")) {
72				$(this).removeClass("active-megamenu");
73				$(".menu-show").removeClass("menu-show");
74			} else {
75				$(this).addClass("active-megamenu");
76				$(".menu-show").removeClass("menu-show");
77				var classList = $(this).attr("class").split(/\s+/);
78				$.each(classList, function (key, item) {
79					var index = $.inArray(item, megaMenuList);
80					if (index != -1) {
81						$(".mega-menu." + item).addClass("menu-show");
82						activeElement = item;
83						return false;
84					}
85				});
86			}
87		});*/
88
89		$(".main-nav > .menu-item-has-children").click(function (e) {
90			e.stopPropagation();
91			// Check if the click is on the menu item with children
92			if ($(this).children(".sub-menu").length > 0) {
93				e.stopPropagation();
94				//e.preventDefault(); // Prevent navigation
95				//$(this).children(".sub-menu").slideToggle(200); // Toggle submenu
96				$(this).toggleClass("open"); // Add/remove "open" class for styling
97			}
98		});
99
100		$(".sub-menu > .menu-item-has-children").click(function (e) {
101			e.stopPropagation();
102			// Check if the click is on the sub-item with children
103			if ($(this).children(".sub-menu").length > 0) {
104				e.stopPropagation();
105				//e.preventDefault(); // Prevent navigation
106				//$(this).children(".sub-sub-menu").slideToggle(200); // Toggle sub-submenu
107				$(this).toggleClass("open"); // Add/remove "open" class for styling
108			}
109		});
110	}
111
112	$(window).resize(function () {
113		width_val = $(window).width();
114		$(".active-megamenu").removeClass("active-megamenu");
115		$(".menu-show").removeClass("menu-show");
116	});
117
118	$(".burger-menu").click(function () {
119		$("ul.navigation").slideToggle();
120		$(".active-megamenu").removeClass("active-megamenu");
121		$(".menu-show").removeClass("menu-show");
122	});
123});
124
125jQuery(document).ready(function ($) {
126	$(".team_description").hide();
127
128	$(".people").click(function () {
129		$(".people")
130			.not(this)
131			.find(".team_description")
132			.each(function () {
133				$(this).slideUp();
134			});
135		$(this).find(".team_description").slideToggle();
136	});
137});

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.