PageSourceSearch

https://www.edgeofamericains.com/wp-content/themes/zywave-elite/js/script_ver-0.0.02.js

js edgeofamericains.com collected 2026-10-08 21:26:18 UTC 5,669 bytes, 227 lines download raw bytes

1jQuery(function () {
2	var preheader = jQuery("header#zy-header");
3	var preheaderHeight = jQuery("header#zy-header").height();
4	jQuery(window).scroll(function () {
5		var scroll = jQuery(window).scrollTop();
6
7		if (scroll >= preheaderHeight / 2) {
8			preheader.addClass("fixed");
9		} else {
10			preheader.removeClass("fixed");
11		}
12	});
13});
14
15jQuery("#zy-zip-submit").click(function(e) {
16	e.preventDefault();
17	
18	var position = jQuery("#zy-footer-form").offset().top - 150;
19
20	jQuery("body, html").animate({
21		scrollTop: position
22	}, 1500 );
23
24	var email = jQuery('#email').val();
25
26	jQuery('#gform_1 #input_1_6' ).val(email);
27
28});
29
30
31jQuery(function () {
32
33	jQuery(".zy-toggle-mobile-nav").click(function () {
34		jQuery("body").toggleClass("zy-mobile-nav-open");
35	});
36
37	jQuery(".zy-hero-slider").bxSlider({
38		auto: true,
39		controls: false,
40		pager: false,
41		speed: 1200,
42		pause: 7000,
43		touchEnabled: false,
44		useCSS: false,
45	});
46
47	// BX Slider speed for "ticker" depends on the amount of slides there are
48	// So we'll get the number of slides and use it to multiply the speed
49	var n = jQuery(".zy-carrier-slideshow > .zy-carrier-slide").length;
50
51	jQuery(".zy-carrier-slideshow").bxSlider({
52		minSlides: 1,
53		maxSlides: 8,
54		slideWidth: 250,
55		slideMargin: 10,
56		ticker: true,
57		speed: 5000 * n,
58	});
59
60	//employee slider changes # of slide to display depending on screen size
61
62	var staffSlider,
63		staffSettings = {
64			auto: true,
65			minSlides: 3,
66			maxSlides: 3,
67			moveSlides: 1,
68			controls: false,
69			slideWidth: 300,
70			ticker: false,
71			speed: 1000,
72			pause: 3000,
73			touchEnabled: false,
74		};
75
76	function init() {
77		staffSettings.maxSlides = window.outerWidth < 767 ? 1 : 3;
78		staffSettings.slideWidth = window.outerWidth < 767 ? 300 : 5000;
79	}
80
81	init();
82	staffSlider = jQuery('.zy-employee-slideshow').bxSlider(staffSettings);
83
84	jQuery(window).resize(function () {
85		if ((window.outerWidth < 768 && window.prevWidth >= 767)
86			|| (window.outerWidth >= 768 && window.prevWidth < 767)) {
87			init();
88			staffSlider.reloadSlider(staffSettings);
89		}
90		window.prevWidth = window.outerWidth;
91	});
92
93
94	//testi slider
95
96	jQuery('.zy-testimonial-slideshow').bxSlider({
97		auto: true,
98		controls: false,
99		slideWidth: 900,
100		speed: 1200,
101		pause: 7000,
102	});
103
104
105	function zy_set_fixed_header() {
106		jQuery(".zy-main-navigation-container").addClass("zy-nav-loading");
107
108		var header_height = jQuery("#zy-header").outerHeight();
109
110		var tallest_dropdown_height = 0;
111
112		// Loop through each top level dropdown
113		jQuery("ul.zy-main-navigation > li > ul > li").each(function () {
114			var current_level_2_item = jQuery(this);
115
116			var distance_from_top_of_browser = current_level_2_item.position().top;
117
118			distance_from_top_of_browser += current_level_2_item.outerHeight();
119
120			distance_from_top_of_browser += header_height;
121
122			if (distance_from_top_of_browser > tallest_dropdown_height) {
123				tallest_dropdown_height = distance_from_top_of_browser;
124			}
125
126			// Find all level 3 dropdowns
127			current_level_2_item.find("> ul > li").each(function () {
128				var current_level_3_item = jQuery(this);
129
130				var this_top =
131					distance_from_top_of_browser + current_level_3_item.position().top;
132
133				if (this_top > tallest_dropdown_height) {
134					tallest_dropdown_height = this_top;
135				}
136			});
137		});
138
139		// The minimum height the browser window need to be to show the whole dropdown
140		var min_screen_height = Math.round(tallest_dropdown_height) + 50;
141
142		// The height of just the header
143		var margin_for_body = Math.round(header_height);
144
145		var style_element = "<style>";
146
147		style_element +=
148			"@media (min-width: 768px) and (min-height: " +
149			min_screen_height +
150			"px ){";
151
152		style_element += "#zy-header { position: fixed; }";
153
154		style_element += "body { margin-top: " + margin_for_body + "px; }";
155
156		style_element += "}";
157
158		style_element += "</style>";
159
160		jQuery("head").append(style_element);
161
162		jQuery(".zy-main-navigation-container").removeClass("zy-nav-loading");
163	}
164
165	zy_set_fixed_header();
166
167	// Animation Trigger
168
169	var observerOptions = {
170		rootMargin: "0px",
171		threshold: 0.5,
172	};
173
174	var observer = new IntersectionObserver(observerCallback, observerOptions);
175
176	function observerCallback(entries, observer) {
177		entries.forEach((entry) => {
178			if (entry.isIntersecting) {
179				entry.target.classList.add("animateActive");
180			}
181		});
182	}
183
184	var animateContent = document.querySelectorAll(".animate");
185
186	animateContent.forEach((animateEntry) => {
187		observer.observe(animateEntry);
188	});
189});
190
191//collapsing mobile nav
192
193var mobile_breakpoint = 768;
194
195var has_children = ".zy-main-navigation .menu-item-has-children > a";
196
197if (window.innerWidth < mobile_breakpoint) {
198
199  // add drop down arrow to nav options with sub-nav
200  jQuery(has_children).append("<i class='fa-solid fa-chevron-down'></i>");
201
202}
203
204jQuery(has_children).click(function (event) {
205  if (window.innerWidth < mobile_breakpoint) {
206    event.preventDefault();
207
208    // Check if the link has already been duplicated
209    var hasDuplicatedLink = jQuery(this).siblings('ul.sub-menu').find('.zy-menu-clone').length > 0;
210
211    // If not, proceed to duplicate the link
212    if (!hasDuplicatedLink) {
213      // Get the link text and URL
214      var linkText = jQuery(this).text();
215      var linkURL = jQuery(this).attr('href');
216
217      // Create a new list item with the duplicated link
218      var duplicatedLink = '<li class="menu-item zy-menu-clone"><a href="' + linkURL + '">' + linkText + '</a></li>';
219
220      // Append the duplicated link to the top of the corresponding .sub-menu
221      jQuery(this).siblings('ul.sub-menu').prepend(duplicatedLink);
222    }
223
224    // Toggle the visibility of the .sub-menu
225    jQuery(this).toggleClass("zy-show");
226  }
227});

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.