PageSourceSearch

https://casfoundation.org.ng/js/main.js

js casfoundation.org.ng collected 2026-09-24 20:16:16 UTC 9,550 bytes, 409 lines download raw bytes

1 AOS.init({
2 	duration: 800,
3 	easing: 'slide',
4 	once: false
5 });
6
7jQuery(document).ready(function($) {
8
9	"use strict";
10
11	// $(".loader").delay(1000).fadeOut("slow");
12 //  $("#overlayer").delay(1000).fadeOut("slow");	
13
14	var siteMenuClone = function() {
15
16		$('.js-clone-nav').each(function() {
17			var $this = $(this);
18			$this.clone().attr('class', 'site-nav-wrap').appendTo('.site-mobile-menu-body');
19		});
20
21
22		setTimeout(function() {
23			
24			var counter = 0;
25      $('.site-mobile-menu .has-children').each(function(){
26        var $this = $(this);
27        
28        $this.prepend('<span class="arrow-collapse collapsed">');
29
30        $this.find('.arrow-collapse').attr({
31          'data-toggle' : 'collapse',
32          'data-target' : '#collapseItem' + counter,
33        });
34
35        $this.find('> ul').attr({
36          'class' : 'collapse',
37          'id' : 'collapseItem' + counter,
38        });
39
40        counter++;
41
42      });
43
44    }, 1000);
45
46		$('body').on('click', '.arrow-collapse', function(e) {
47      var $this = $(this);
48      if ( $this.closest('li').find('.collapse').hasClass('show') ) {
49        $this.removeClass('active');
50      } else {
51        $this.addClass('active');
52      }
53      e.preventDefault();  
54      
55    });
56
57		$(window).resize(function() {
58			var $this = $(this),
59				w = $this.width();
60
61			if ( w > 768 ) {
62				if ( $('body').hasClass('offcanvas-menu') ) {
63					$('body').removeClass('offcanvas-menu');
64				}
65			}
66		})
67
68		$('body').on('click', '.js-menu-toggle', function(e) {
69			var $this = $(this);
70			e.preventDefault();
71
72			if ( $('body').hasClass('offcanvas-menu') ) {
73				$('body').removeClass('offcanvas-menu');
74				$this.removeClass('active');
75			} else {
76				$('body').addClass('offcanvas-menu');
77				$this.addClass('active');
78			}
79		}) 
80
81		// click outisde offcanvas
82		$(document).mouseup(function(e) {
83	    var container = $(".site-mobile-menu");
84	    if (!container.is(e.target) && container.has(e.target).length === 0) {
85	      if ( $('body').hasClass('offcanvas-menu') ) {
86					$('body').removeClass('offcanvas-menu');
87				}
88	    }
89		});
90	}; 
91	siteMenuClone();
92
93
94	var sitePlusMinus = function() {
95		$('.js-btn-minus').on('click', function(e){
96			e.preventDefault();
97			if ( $(this).closest('.input-group').find('.form-control').val() != 0  ) {
98				$(this).closest('.input-group').find('.form-control').val(parseInt($(this).closest('.input-group').find('.form-control').val()) - 1);
99			} else {
100				$(this).closest('.input-group').find('.form-control').val(parseInt(0));
101			}
102		});
103		$('.js-btn-plus').on('click', function(e){
104			e.preventDefault();
105			$(this).closest('.input-group').find('.form-control').val(parseInt($(this).closest('.input-group').find('.form-control').val()) + 1);
106		});
107	};
108	// sitePlusMinus();
109
110
111	var siteSliderRange = function() {
112    $( "#slider-range" ).slider({
113      range: true,
114      min: 0,
115      max: 500,
116      values: [ 75, 300 ],
117      slide: function( event, ui ) {
118        $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
119      }
120    });
121    $( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) +
122      " - $" + $( "#slider-range" ).slider( "values", 1 ) );
123	};
124	// siteSliderRange();
125
126
127	
128
129	var siteCarousel = function () {
130		if ( $('.nonloop-block-13').length > 0 ) {
131			$('.nonloop-block-13').owlCarousel({
132		    center: false,
133		    items: 1,
134		    loop: true,
135				stagePadding: 0,
136		    margin: 0,
137		    smartSpeed: 1000,
138		    autoplay: true,
139		    nav: true,
140				navText: ['<span class="icon-arrow_back">', '<span class="icon-arrow_forward">'],
141		    responsive:{
142	        600:{
143	        	margin: 0,
144	        	nav: true,
145	          items: 2
146	        },
147	        1000:{
148	        	margin: 0,
149	        	stagePadding: 0,
150	        	nav: true,
151	          items: 2
152	        },
153	        1200:{
154	        	margin: 0,
155	        	stagePadding: 0,
156	        	nav: true,
157	          items: 3
158	        }
159		    }
160			});
161		}
162
163		let owl2 = $('.slide-one-item-alt-text').owlCarousel({
164	    center: false,
165	    items: 1,
166	    loop: true,
167			stagePadding: 0,
168	    margin: 0,
169	    smartSpeed: 1000,
170	    autoplay: true,
171	    pauseOnHover: true,
172	    onDragged: function(event) {
173	    	console.log('event : ',event.relatedTarget['_drag']['direction'])
174	    	if ( event.relatedTarget['_drag']['direction'] == 'left') {
175	    		$('.owl-1').trigger('next.owl.carousel');
176	    	} else {
177	    		$('.owl-1').trigger('prev.owl.carousel');
178	    	}
179	    }
180	  });
181
182		let owl = $('.owl-1').owlCarousel({
183			// animateOut: 'fadeOut',
184			center: true,
185			items: 1,
186			loop: true,
187			margin: 0,
188			smartSpeed: 1500,
189			dots: true,
190	    autoplay: true,
191	    pauseOnHover: false,
192	    onDragged: function(event) {
193	    	console.log('event : ',event.relatedTarget['_drag']['direction'])
194	    	if ( event.relatedTarget['_drag']['direction'] == 'left') {
195	    		$('.slide-one-item-alt-text').trigger('next.owl.carousel');
196	    	} else {
197	    		$('.slide-one-item-alt-text').trigger('prev.owl.carousel');
198	    	}
199	    }
200		})
201
202		$( '.owl-dot' ).on( 'click', function() {
203		  console.log(owl2.trigger('to.owl.carousel', $(this).index()));
204		})
205
206
207
208
209		$('.owl-2').owlCarousel({
210			animateOut: 'fadeOut',
211			center: true,
212			items: 1,
213			loop: true,
214			margin: 0,
215			smartSpeed: 1500,
216	    autoplay: true,
217	    pauseOnHover: false
218		});
219		$('.owl-3').owlCarousel({
220			animateOut: 'fadeOut',
221			center: true,
222			items: 1,
223			loop: true,
224			margin: 0,
225			smartSpeed: 1500,
226	    autoplay: true,
227	    pauseOnHover: false
228		})
229
230		$('.slide-one-item').owlCarousel({
231	    center: false,
232	    items: 1,
233	    loop: true,
234			stagePadding: 0,
235	    margin: 0,
236	    smartSpeed: 1500,
237	    autoplay: true,
238	    pauseOnHover: false,
239	    dots: true,
240	    nav: false,
241	    navText: ['<span class="icon-keyboard_arrow_left">', '<span class="icon-keyboard_arrow_right">']
242	  });
243
244
245	  
246
247	  $('.slide-one-item-alt').owlCarousel({
248	    center: false,
249	    items: 1,
250	    loop: true,
251			stagePadding: 0,
252	    margin: 0,
253	    smartSpeed: 1000,
254	    autoplay: true,
255	    pauseOnHover: true,
256	    onDragged: function(event) {
257	    	console.log('event : ',event.relatedTarget['_drag']['direction'])
258	    	if ( event.relatedTarget['_drag']['direction'] == 'left') {
259	    		$('.slide-one-item-alt-text').trigger('next.owl.carousel');
260	    	} else {
261	    		$('.slide-one-item-alt-text').trigger('prev.owl.carousel');
262	    	}
263	    }
264	  });
265
266	  if ( $('.owl-all').length > 0 ) {
267			$('.owl-all').owlCarousel({
268		    center: false,
269		    items: 1,
270		    loop: false,
271				stagePadding: 0,
272		    margin: 0,
273		    autoplay: false,
274		    nav: false,
275		    dots: true,
276		    touchDrag: true,
277  			mouseDrag: true,
278  			smartSpeed: 1000,
279				navText: ['<span class="icon-arrow_back">', '<span class="icon-arrow_forward">'],
280		    responsive:{
281	        768:{
282	        	margin: 30,
283	        	nav: false,
284	        	responsiveRefreshRate: 10,
285	          items: 1
286	        },
287	        992:{
288	        	margin: 30,
289	        	stagePadding: 0,
290	        	nav: false,
291	        	responsiveRefreshRate: 10,
292	        	touchDrag: false,
293  					mouseDrag: false,
294	          items: 3
295	        },
296	        1200:{
297	        	margin: 30,
298	        	stagePadding: 0,
299	        	nav: false,
300	        	responsiveRefreshRate: 10,
301	        	touchDrag: false,
302  					mouseDrag: false,
303	          items: 3
304	        }
305		    }
306			});
307		}
308		
309	};
310	siteCarousel();
311
312	
313
314	var siteCountDown = function() {
315
316		$('#date-countdown').countdown('2020/10/10', function(event) {
317		  var $this = $(this).html(event.strftime(''
318		    + '<span class="countdown-block"><span class="label">%w</span> weeks </span>'
319		    + '<span class="countdown-block"><span class="label">%d</span> days </span>'
320		    + '<span class="countdown-block"><span class="label">%H</span> hr </span>'
321		    + '<span class="countdown-block"><span class="label">%M</span> min </span>'
322		    + '<span class="countdown-block"><span class="label">%S</span> sec</span>'));
323		});
324				
325	};
326	// siteCountDown();
327
328	var siteDatePicker = function() {
329
330		if ( $('.datepicker').length > 0 ) {
331			$('.datepicker').datepicker();
332		}
333
334	};
335	// siteDatePicker();
336
337	var siteSticky = function() {
338		$(".js-sticky-header").sticky({topSpacing:0});
339	};
340	siteSticky();
341
342	// navigation
343  var OnePageNavigation = function() {
344    var navToggler = $('.site-menu-toggle');
345
346   	$("body").on("click", ".main-menu li a[href^='#'], .smoothscroll[href^='#'], .site-mobile-menu .site-nav-wrap li a[href^='#']", function(e) {
347      e.preventDefault();
348
349      var hash = this.hash;
350
351      $('html, body').animate({
352        'scrollTop': $(hash).offset().top - 50
353      }, 600, 'easeInOutExpo', function() {
354        // window.location.hash = hash;
355
356      });
357
358    });
359  };
360  OnePageNavigation();
361
362  var siteScroll = function() {
363
364  	
365
366  	$(window).scroll(function() {
367
368  		var st = $(this).scrollTop();
369
370  		if (st > 100) {
371  			$('.js-sticky-header').addClass('shrink');
372  		} else {
373  			$('.js-sticky-header').removeClass('shrink');
374  		}
375
376  	}) 
377
378  };
379  siteScroll();
380
381
382  var counter = function() {
383		
384		$('#about-section').waypoint( function( direction ) {
385
386			if( direction === 'down' && !$(this.element).hasClass('ftco-animated') ) {
387
388				var comma_separator_number_step = $.animateNumber.numberStepFactories.separator(',')
389				$('.number > span').each(function(){
390					var $this = $(this),
391						num = $this.data('number');
392					$this.animateNumber(
393					  {
394					    number: num,
395					    numberStep: comma_separator_number_step
396					  }, 7000
397					);
398				});
399				
400			}
401
402		} , { offset: '95%' } );
403
404	}
405	counter();
406
407
408
409});

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.