PageSourceSearch

https://productstewardship.us/wp-content/themes/psi/custom.js?ver=7.1.2

js productstewardship.us collected 2026-10-02 03:28:51 UTC 11,596 bytes, 480 lines download raw bytes

1
2var $=jQuery.noConflict(); //For slick slider for jquery 2.2.4
3
4//Add parent class
5function parentClass() {
6    jQuery('.add_row_class').each(function() {
7        jQuery(this).parents('.et_pb_section').last().addClass(jQuery(this).attr('row_class'));
8    });
9}
10
11//Full height row
12function fullheight(){
13    jQuery('.full-height-row').each(function() {
14    	
15    	$window_H = jQuery(window).height();
16    	//$header_H = jQuery('.masthead').outerHeight();
17    	$box_h = $window_H;
18        jQuery(this).height($box_h);
19        
20    });
21}
22
23//Same Height
24function sameheight(elementclass){
25	jQuery(elementclass).css('height','auto');
26	el_height = 0;
27	jQuery(elementclass).each(function(){
28		if(jQuery(this).outerHeight() > el_height){
29			el_height = jQuery(this).outerHeight();
30		}
31	});
32	jQuery(elementclass).outerHeight(el_height);
33}
34
35//Square Box
36function squarebox(elementclass){
37	jQuery(elementclass).css('height','auto');
38	 jQuery(elementclass).each(function() {
39	        var boxW = jQuery(this).outerWidth();
40	        jQuery(this).outerHeight(boxW);
41	 });
42	 
43};
44
45//Lazyload
46function check_if_in_view_OneWay() {
47	var animation_elements = jQuery('.animate');
48	var lazy_elements = jQuery('.lazyload-files');
49	var window_height = jQuery(window).height();
50	var window_top_position = jQuery(window).scrollTop();
51	var halfscreen =  window_height / 10;
52	var window_bottom_position = window_top_position + window_height;
53
54
55	//Lazyload
56	jQuery.each(lazy_elements, function() {
57		var element = jQuery(this);
58		var element_height = element.outerHeight();
59		
60		var window_W = jQuery(window).width();
61		if(window_W < 768){
62			var $extra = 200;
63		}else{
64			var $extra = 200;
65		}
66	
67		var element_top_position = element.offset().top - $extra;
68		var element_bottom_position = (element_top_position + element_height) ;
69		
70		if(!element.hasClass("loaded")){
71			if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position)) {
72				
73				var bg = element.attr('data-src');
74				
75				if(element.hasClass("lazyload-bg")){
76					element.css('background-image', 'url(' + bg + ')');
77				}else{
78					element.attr('src',bg);
79				}
80				
81				element.addClass("loaded");
82
83			}else{
84
85			}
86		}
87	});
88	
89	//Animations
90		jQuery.each(animation_elements, function() {
91
92			var window_W = jQuery(window).width();
93			if(window_W < 768){
94				var $extra = 50;
95			}else{
96				var $extra = 100;
97			}
98
99			var element = jQuery(this);
100			var element_height = element.outerHeight();
101			var element_top_position = element.offset().top + $extra;
102			var element_bottom_position = (element_top_position + element_height);
103
104			if(element.hasClass("lazy-header")){
105				setTimeout(function(){
106					element.addClass('start');
107				},1000);
108			} else if(element.hasClass("counter")){//Counter
109				if(element.hasClass("start")){
110
111				}else{
112					if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position)) {
113						element.addClass('start');
114						
115						var sti = 0;
116						var drt = 3000;
117						if(element.hasClass('counter-decimal')){
118							element.prop('Counter', 0).animate({
119								Counter: element.data('count')
120							  }, {
121								duration: drt,
122								easing: 'swing',
123								step: function(now) {
124									element.text(this.Counter.toFixed(element.data('count') % 1 === 0 ? 0 : 1));
125								}
126							  });
127						} else {
128							element.prop('Counter', sti).animate({
129								Counter: element.text()
130							}, {
131								duration: drt,
132								easing: 'swing',
133								step: function (now) {
134									element.text(Math.ceil(now));
135								}
136							});
137						}
138	
139					} else {
140					}
141				}
142	
143			} else { //General
144				if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position - halfscreen)) {
145					element.addClass('start');
146
147					if(element.hasClass("timeline-slider-container")){
148						jQuery('.timeline-slider-container').addClass('slider-in-view');
149						//$('.slider-in-view').slick('slickSetOption', 'autoplay', true, true);
150					}
151
152				} else {
153				}
154			}
155			
156		});
157	
158
159
160}
161
162//Animate Hero
163function animate_hero() {
164	var animation_elements = jQuery('.animate-hero');
165	
166	jQuery.each(animation_elements, function() {
167		var element = jQuery(this);
168
169		if(element.hasClass('animate-bg')){
170			setTimeout(function(){
171				element.addClass('start');
172			},500);
173		}else if(element.hasClass('animate-text')){
174			setTimeout(function(){
175				element.addClass('start');
176			},1000);
177		}else if(element.hasClass('animate-header')){
178			setTimeout(function(){
179				element.addClass('start');
180			},2000);
181		}	
182	});
183}
184
185
186jQuery(document).ready(function(){
187    parentClass();
188
189	jQuery('.main-website-content').css('opacity','1');
190	animate_hero();
191
192	setTimeout(function(){
193    	check_if_in_view_OneWay();
194	},1000); //Content jumps up on document ready trigerring the animations for the first sections eventhough they are not in view
195
196	fullheight();
197	jQuery('.site-footer').css('opacity','1');
198
199	$('.quotes-slider-container').slick({
200		slidesToShow: 1,
201		slidesToScroll: 1,
202		arrows: true,
203		dots: false,
204		infinite: true,
205		prevArrow: '<button type="button" class="slick-prev"></button>',
206		nextArrow: '<button type="button" class="slick-next"></button>',
207    });
208
209	$('.home .timeline-slider-container').slick({
210		slidesToShow: 11,
211		slidesToScroll: 1,
212		arrows: true,
213		dots: false,
214		infinite: false,
215		autoplay: false, /* autoplay in view */
216		autoplaySpeed: 3000,
217		pauseOnHover:false,
218		pauseOnFocus:false,
219		focusOnSelect: false,
220		variableWidth: true,
221		swipeToSlide: true,
222		touchThreshold:20,
223		//touchMove:false,
224		prevArrow: '<button type="button" class="slick-prev"></button>',
225		nextArrow: '<button type="button" class="slick-next"></button>',
226		responsive: [
227			{
228				breakpoint: 1700,
229				settings: {
230				  slidesToShow: 10,
231			  }
232			},
233			{
234				breakpoint: 1550,
235				settings: {
236				  slidesToShow: 9,
237				}
238			},
239			{
240				breakpoint: 1400,
241				settings: {
242				  slidesToShow: 8,
243				}
244			},
245			{
246				breakpoint: 1024,
247				settings: {
248				  slidesToShow: 7,
249				  autoplay: false,
250				  autoplaySpeed: 4000,
251				}
252			},
253			{
254				breakpoint: 768,
255				settings: {
256				  slidesToShow: 5,
257				  autoplay: false,
258				  autoplaySpeed: 4000,
259				}
260			},
261			{
262				breakpoint: 640,
263				settings: {
264				  slidesToShow: 4,
265				  autoplay: false,
266				  autoplaySpeed: 4000,
267				}
268			},
269			{
270				breakpoint: 480,
271				settings: {
272				  slidesToShow: 3,
273				  autoplay: false,
274				  autoplaySpeed: 4000,
275				}
276			},
277			{
278				breakpoint: 374,
279				settings: {
280				  slidesToShow: 2,
281				  autoplay: false,
282				  autoplaySpeed: 4000,
283				}
284			},
285		  ]
286    });
287
288	$('.innerpage-content .timeline-slider-container').slick({
289		slidesToShow: 8,
290		slidesToScroll: 1,
291		arrows: true,
292		dots: false,
293		infinite: false,
294		autoplay: false, /* autoplay in view */
295		autoplaySpeed: 3000,
296		pauseOnHover:false,
297		pauseOnFocus:false,
298		focusOnSelect: false,
299		variableWidth: true,
300		swipeToSlide: true,
301		touchThreshold:20,
302		//touchMove:false,
303		prevArrow: '<button type="button" class="slick-prev"></button>',
304		nextArrow: '<button type="button" class="slick-next"></button>',
305		responsive: [
306			{
307				breakpoint: 1700,
308				settings: {
309				  slidesToShow: 8,
310			  }
311			},
312			{
313				breakpoint: 1550,
314				settings: {
315				  slidesToShow: 7,
316				}
317			},
318			{
319				breakpoint: 1400,
320				settings: {
321				  slidesToShow: 6,
322				}
323			},
324			{
325				breakpoint: 1024,
326				settings: {
327				  slidesToShow: 7,
328				  autoplay: false,
329				  autoplaySpeed: 4000,
330				}
331			},
332			{
333				breakpoint: 768,
334				settings: {
335				  slidesToShow: 5,
336				  autoplay: false,
337				  autoplaySpeed: 4000,
338				}
339			},
340			{
341				breakpoint: 640,
342				settings: {
343				  slidesToShow: 4,
344				  autoplay: false,
345				  autoplaySpeed: 4000,
346				}
347			},
348			{
349				breakpoint: 480,
350				settings: {
351				  slidesToShow: 3,
352				  autoplay: false,
353				  autoplaySpeed: 4000,
354				}
355			},
356			{
357				breakpoint: 374,
358				settings: {
359				  slidesToShow: 2,
360				  autoplay: false,
361				  autoplaySpeed: 4000,
362				}
363			},
364		  ]
365    });
366
367
368	$('.products-listing-container').slick({
369		slidesToShow: 5,
370		slidesToScroll: 1,
371		speed: 500,
372		arrows: true,
373		prevArrow: '<button type="button" class="slick-prev"></button>',
374		nextArrow: '<button type="button" class="slick-next"></button>',
375		dots: false,
376		infinite: true,
377		centerMode: true,
378		variableWidth: true,
379		touchMove: false,
380		//autoplay: true,
381		autoplaySpeed: 3000,
382    });
383
384	jQuery('body').on('click','.menu-icons .icon-search', function(){
385		jQuery('body').addClass('open-search');
386	});
387	jQuery('body').on('click','.search-close', function(){
388		jQuery('body').removeClass('open-search');
389	});
390
391	jQuery('body').on('click','.menu--stripes', function(){
392		jQuery('body').toggleClass('open_menu');
393	});
394
395	jQuery('body').on('click','.menu-item.menu-item-has-children.nofollow > a', function(e){
396		e.preventDefault();
397	});
398
399	jQuery('body').on('click','.menu-item.menu-item-has-children > a', function(e){
400
401		$window_W = jQuery(window).width();
402		if($window_W < 1280){
403			e.preventDefault();
404		}
405		jQuery('.menu-item').removeClass('open-submenu');
406		jQuery(this).parent('li').addClass('open-submenu');
407	});
408
409	jQuery('body').on('click','.icon-translate img', function(e){
410		jQuery(this).parents('.icon-translate').toggleClass('open-switcher-dropdown');
411	});
412
413	jQuery('li.scrolltomedia').find('a[href*="#"]:not([href="#"])').click(function(t) {
414		var headerheight = parseInt(jQuery('.masthead ').outerHeight());
415		
416		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
417			var target = jQuery(this.hash);
418			target = target.length ? target : jQuery('[name=' + this.hash.slice(1) +']');
419			
420			if (target.length) {
421				jQuery('html, body').animate({
422					scrollTop: target.offset().top - headerheight
423				}, 1000);
424				
425				jQuery('body').removeClass('open_menu');
426				return false;
427			}else{
428	
429			}
430		}
431	});
432
433	//sameheight('.product-content');
434	//sameheight('.product-info');
435	sameheight('.events-list .each-product .product-title');
436	sameheight('.product-info .product-title');
437
438});
439var lastScrollTop = 0;
440jQuery(window).scroll(function() {
441	check_if_in_view_OneWay();
442
443	//Header Show/Hide
444	var hero = jQuery('.hero-section-box').outerHeight();
445	var scroll = jQuery(window).scrollTop();
446	var st = jQuery(this).scrollTop();
447
448	/* if(hero > scroll){
449		jQuery('.masthead').removeClass('hidden-header');
450	} else {
451		if(hero <= scroll){
452			jQuery('.masthead').addClass('hidden-header');
453
454			if (st > lastScrollTop){
455				//Scroll Down
456			} else {
457				//Scroll Up
458				jQuery('.masthead').removeClass('hidden-header');
459			}
460		}
461		
462	}
463	lastScrollTop = st; */
464});
465
466jQuery(window).on('load',function () {
467	fullheight();
468	//sameheight('.product-content');
469	//sameheight('.product-info');
470	sameheight('.events-list .each-product .product-title');
471	sameheight('.product-info .product-title');
472});
473
474jQuery(window).on('resize',function () {
475	fullheight();
476	//sameheight('.product-content');
477	//sameheight('.product-info');
478	sameheight('.events-list .each-product .product-title');
479	sameheight('.product-info .product-title');
480});

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.