PageSourceSearch

https://idcanada.org/wp-content/themes/Divi-child/custom.js

js idcanada.org collected 2026-10-03 19:48:20 UTC 1,701 bytes, 55 lines download raw bytes

1jQuery( document ).ready(function() {
2	
3	// add class when scrolling
4	jQuery(window).scroll(function() {    
5    var scroll = jQuery(window).scrollTop();
6    if (scroll >= 113) {
7        jQuery("header").addClass("et-fixed-header");
8    } else {
9		jQuery("header").removeClass("et-fixed-header");
10	}
11	}); //missing );
12	
13	//random owl
14	var owl = jQuery('.owl-carousel');
15	(function($){
16		$.fn.shuffle = function() {
17			var allElems = this.get(),
18				getRandom = function(max) {
19					return Math.floor(Math.random() * max);
20				},
21				shuffled = $.map(allElems, function(){
22					var random = getRandom(allElems.length),
23						randEl = $(allElems[random]).clone(true)[0];
24					allElems.splice(random, 1);
25					return randEl;
26				});
27			this.each(function(i){
28				$(this).replaceWith($(shuffled[i]));
29			});
30			return $(shuffled);
31		};
32	})(jQuery);
33	// Replace first class in function below if you have a custom class for your owl slider.
34	// Replace second class with the class or element tag for each the items of slider.
35	jQuery(function () {
36		jQuery(".owl-carousel .owl-item ").shuffle();
37		owl.owlCarousel();
38	});
39
40	// swap order of elements of news page
41	jQuery( ".news-events-section article" ).each(function( index ) {
42       jQuery(this).children(".post-meta").insertAfter(jQuery(this).children(".entry-featured-image-url"));
43	 });
44
45
46	// close nav bar when user click away
47	const menu = jQuery('.et_slide_in_menu_container');
48	jQuery(document).mouseup(function (e) {
49		if (!menu.is(e.target) // if the target of the click isn't the container...
50			&& menu.has(e.target).length === 0) // ... nor a descendant of the container
51		{
52			menu.removeClass('et_pb_fullscreen_menu_opened');
53		}
54	});
55});	

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.