PageSourceSearch

https://csc.ca/wp-content/themes/CSC-2019/js/scripts.js?ver=1.1

js csc.ca collected 2026-10-02 07:46:27 UTC 4,617 bytes, 201 lines download raw bytes

1	$ = jQuery.noConflict();
2
3	//HTML5 MARKUP
4	document.createElement('main');
5	document.createElement('article');
6    document.createElement('section');
7    document.createElement('aside');
8    document.createElement('hgroup');
9    document.createElement('nav');
10    document.createElement('header');
11    document.createElement('footer');
12    document.createElement('figure');
13    document.createElement('figcaption');
14
15	// JQUERY DOCUMENT READY FUNCTIONS
16	$(document).ready(function()
17	{
18
19		//REPOSITION NAVIGATION ON REFRESH
20		if(window.scrollY==0){ } else {
21			$('#header').addClass('nav-up').removeClass('nav-down');
22		}
23
24		//WOW
25		new WOW().init();
26
27		//READ MORE
28		$('.readMore').on('click', function(){
29			var target = $(this).attr('rel');
30			$("#extendedContent"+target).show();
31			$(this).hide();
32	    });
33
34		// BIO OVERLAY
35		if($('.pageOverlay').length) {
36			$('.openBio').on('click', function(){
37				$('body').addClass('noScroll');
38				$('.pageOverlay').addClass('open');
39
40				var target = $(this).attr('rel');
41				$(".pageOverlay #bio"+target).show();
42			});
43
44			$('.closeBtn').on('click', function(){
45				$('body').removeClass('noScroll');
46				$('.pageOverlay').removeClass('open');
47				$(".pageOverlay .bio").hide();
48			});
49		}
50
51	    //SHOW MORE BUTTON
52		$('#showBtn').on('click', function(){
53			$(".hide").show();
54			$(this).hide();
55	    });
56
57	    // ACCORDIAN EXPAND
58		$('.accordianTitle').on('click', function(){
59			var target = $(this).attr('rel');
60			$("#accordianBody"+target).slideToggle();
61			$(this).children('.down').toggle();
62			$(this).children('.up').toggle();
63		});
64
65		// SCROLL FUNCTIONS
66		$('.scroll').click(function(){
67		    $('html, body').animate({
68		        scrollTop: $( $.attr(this, 'href') ).offset().top
69		    }, 500);
70		    return false;
71		});
72
73       // OWL CAROUSEL
74       $('.owl-carousel.magazines').owlCarousel({
75		    loop:true,
76		    margin:20,
77		    dots:true,
78		    responsive:{
79		        0:{
80		            items:1
81		        },
82		        600:{
83		            items:3
84		        },
85		        1000:{
86		            items:4
87		        }
88		    }
89		});
90
91		$('.owl-carousel.sponsorlogos').owlCarousel({
92		    loop: true,
93		    dots:false,
94			nav: true,
95		    margin:20,
96		    autoplay: true,
97		    responsive:{
98		        0:{
99		            items:2
100		        },
101		        600:{
102		            items:4
103		        },
104		        1000:{
105		            items:6
106		        }
107		    }
108		});
109
110		// MOBILE BUTTON
111		var action = 1;
112
113		(function() {
114			"use strict";
115			var toggles = document.querySelectorAll(".c-hamburger");
116
117			for (var i = toggles.length - 1; i >= 0; i--) {
118				var toggle = toggles[i];
119				toggleHandler(toggle);
120			};
121
122			function toggleHandler(toggle) {
123				toggle.addEventListener( "click", function(e) {
124					e.preventDefault();
125					(this.classList.contains("is-active") === true) ? this.classList.remove("is-active") : this.classList.add("is-active");
126				});
127			}
128
129		})();
130
131		$('.c-hamburger').on('click', showmenu);
132
133		function removeMenuClasses() {
134			$('.menu').removeClass('open animated fadeOut fadeIn');
135		}
136
137		function showmenu() {
138			if( action == 1 ) {
139				$('.menu').addClass('open animated fadeIn');
140				$('body').addClass('noScroll');
141				action = 2;
142			} else {
143				$('.menu').addClass('fadeOut');
144				$('body').removeClass('noScroll');
145				setTimeout(removeMenuClasses, 500);
146				action = 1;
147			}
148		}
149
150
151	});
152
153	// HIDE HEADER ON SCROLL DOWN
154	var didScroll;
155	var lastScrollTop = 0;
156	var delta = 5;
157	var navbarHeight = $('#header').outerHeight();
158
159	$(window).scroll(function(event){
160	    didScroll = true;
161	});
162
163	setInterval(function() {
164	    if (didScroll) {
165	        hasScrolled();
166	        didScroll = false;
167	    }
168	}, 250);
169
170	function hasScrolled() {
171	    var st = $(this).scrollTop();
172
173	    // Make sure they scroll more than delta
174	    if(Math.abs(lastScrollTop - st) <= delta)
175	        return;
176
177	    // If they scrolled down and are past the navbar, add class .nav-up.
178	    // This is necessary so you never see what is "behind" the navbar.
179	    if (st > lastScrollTop && st > navbarHeight){
180	        // Scroll Down
181	        $('#header').removeClass('nav-down').addClass('nav-up');
182	    } else {
183	        // Scroll Up
184	        if(st + $(window).height() < $(document).height()) {
185	            $('#header').removeClass('nav-up').addClass('nav-down');
186	        }
187	    }
188
189	    lastScrollTop = st;
190	}
191
192	var distance = $('div').offset().top + 200,
193	    $window = $(window);
194
195	$window.scroll(function() {
196	    if ( $window.scrollTop() >= distance ) {
197	        $('#header').addClass('solid');
198	    } else {
199		    $('#header').removeClass('solid');
200	    }
201	});

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.