PageSourceSearch

https://www.ecowas.int/wp-content/themes/ecowas/assets/js/main.js

js ecowas.int collected 2026-10-02 02:23:43 UTC 16,835 bytes, 779 lines download raw bytes

1jQuery(function ($) {
2    'use strict';
3
4	/*----------------------------------------------
5	  Init WOW animation
6	----------------------------------------------*/
7	new WOW().init();
8
9    /* Swiper Gallery (Anniversary) */
10	var swiper = new Swiper(".mySwiper", {
11		loop: true,
12		spaceBetween: 2,
13		slidesPerView: 5,
14		freeMode: true,
15		watchSlidesProgress: true,
16		autoplay: true,
17		// autoHeight: true,
18		centeredSlides: true,
19		scrollbar: {
20			el: '.swiper-scrollbar',
21			draggable: true,
22		  },
23		  longSwipeMs: 6000,
24		  speed: 4000,
25
26	});
27	
28	var swiper2 = new Swiper(".mySwiper2", {
29		loop: true,
30		spaceBetween: 2,
31		height: 400,
32		// autoHeight: true,
33		navigation: {
34			nextEl: ".swiper-button-next",
35			prevEl: ".swiper-button-prev",
36		},
37		thumbs: {
38			swiper: swiper,
39		},
40		autoplay: true,
41		effect: 'fade',
42		fadeEffect: {
43		  crossFade: true,
44		},
45		longSwipeMs: 6000,
46		speed: 4000,
47	});
48
49	/*----------------------------------------------
50	 Hero Banner Slides
51	----------------------------------------------*/
52	 // hero slider
53	 $('.hero-slider').owlCarousel({
54        loop: true,
55        nav: true,
56        dots: false,
57        margin: 0,
58        autoplay: true,
59        autoplayHoverPause: true,
60        autoplayTimeout: 5000,
61        items: 1,
62        navText: [
63            "<i class='far fa-long-arrow-left'></i>",
64            "<i class='far fa-long-arrow-right'></i>"
65        ],
66
67        onInitialized: function(event) {
68        var $firstAnimatingElements = $('.owl-item').eq(event.item.index).find("[data-animation]");
69        doAnimations($firstAnimatingElements);
70        },
71
72        onChanged: function(event){
73        var $firstAnimatingElements = $('.owl-item').eq(event.item.index).find("[data-animation]");
74        doAnimations($firstAnimatingElements);
75        }
76    });
77
78    //hero slider do animations
79    function doAnimations(elements) {
80		var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
81		elements.each(function () {
82			var $this = $(this);
83			var $animationDelay = $this.data('delay');
84			var $animationDuration = $this.data('duration');
85			var $animationType = 'animated ' + $this.data('animation');
86			$this.css({
87				'animation-delay': $animationDelay,
88				'-webkit-animation-delay': $animationDelay,
89                'animation-duration': $animationDuration,
90                '-webkit-animation-duration': $animationDuration,
91			});
92			$this.addClass($animationType).one(animationEndEvents, function () {
93				$this.removeClass($animationType);
94			});
95		});
96	}
97
98	/*----------------------------------------------
99	 Front Banner Slides
100	----------------------------------------------*/
101	$('.front-new-banner-slide').owlCarousel({
102		loop: true,
103		nav: true,
104		dots: false,
105		autoplayHoverPause: true,
106		autoplay: true,
107		margin: 0,
108		autoHeight: false,
109		autoplayTimeout: 8000,
110		// animateOut: 'slideOutUp',
111		animateIn: 'slideInUp',
112		fluidSpeed: 2000,
113		autoplaySpeed: 2000,
114		smartSpeed: 2000,
115		transitionStyle : "zoomInRight",
116		navText: [
117			"<i class='bx bx-chevron-left bx-2-green'></i>",
118			"<i class='bx bx-chevron-right bx-2-green'></i>"
119		],
120		responsive: {
121			0: {
122				items: 1,
123			},
124			576: {
125				items: 1,
126			},
127			768: {
128				items: 1,
129			},
130			1200: {
131				items: 1,
132			}
133		}
134	});
135
136	/*----------------------------------------------
137	 Specialized Portals Slides
138	----------------------------------------------*/
139	/* $('.slide-up-news').owlCarousel({
140		loop: true,
141		nav: true,
142		dots: false,
143		autoplayHoverPause: true,
144		autoplay: false,
145		margin: 30,
146		autoHeight: true,
147		animateOut: 'slideOutUp',
148  		animateIn: 'slideInUp',
149		navText: [
150			"<i class='bx bx-chevron-left bx-2-green'></i>",
151			"<i class='bx bx-chevron-right bx-2-green'></i>"
152		],
153		responsive: {
154			0: {
155				items: 1,
156			},
157			576: {
158				items: 1,
159			},
160			768: {
161				items: 1,
162			},
163			1200: {
164				items: 1,
165			}
166		}
167	}); */
168
169	/*----------------------------------------------
170	 Specialized Portals Slides
171	----------------------------------------------*/
172	$('.specialized-portal-posts-slide').owlCarousel({
173		loop: true,
174		nav: true,
175		dots: false,
176		autoplayHoverPause: true,
177		autoplay: true,
178		margin: 30,
179		autoHeight: true,
180		navText: [
181			"<i class='bx bx-chevron-left bx-2-green'></i>",
182			"<i class='bx bx-chevron-right bx-2-green'></i>"
183		],
184		responsive: {
185			0: {
186				items: 1,
187			},
188			576: {
189				items: 1,
190			},
191			768: {
192				items: 3,
193			},
194			1200: {
195				items: 4,
196			}
197		}
198	});
199
200	 // fun fact counter
201	 $('.counter').countTo();
202	 $('.counter-box').appear(function () {
203		 $('.counter').countTo();
204	 }, {
205		 accY: -100
206	 });
207
208	$( 'li' ).has( 'ul.dropdown-menu' ).children( 'li > a' ).append( "&nbsp; <i class='bx bx-chevron-down'></i>" );
209	$( 'ul.dropdown-menu' ).find( 'i.bx-chevron-down' ).removeClass( "bx-chevron-down" ).addClass("bx-chevron-right");
210
211
212	/* Disable Active Language Button */
213	// console.log($("ul.top-header-others > li.menu-item-language-current > a"));
214	if( $("ul.top-header-others > li.menu-item-language-current > a")
215	.removeAttr("href") ){
216		$("ul.top-header-others > li.menu-item-language-current > a")
217			.attr({
218				"role": "link",
219				// "aria-disabled" : true,
220			});
221
222	}
223
224	/* Explore button toggle */
225	$( '#explore-button' ).click( function(e){
226		e.stopPropagation();
227
228		$( this ).siblings( 'div.nwp-explore-links' ).toggle();
229		$( this ).toggleClass('arrow');
230	} );
231
232	/* Language Menu Dropdown Icon */
233	$( 'ul#menu-language-menu li.menu-item-language-current > a > span' ).append( "&nbsp; <span class='bx bx-chevron-down'></span>" );	
234
235	/* Light List Dropdown Icon */
236	$( 'ul.nwp-light-list li' ).has( 'ul.sub-menu' ).children( 'li > a' ).append( "&nbsp; <i class='bx bx-chevron-left'></i>" );	
237
238	// Audio player
239	$(function() {
240		$('.ecowas-anthem audio').audioPlayer();
241	  });
242	/* $( window ).resize(function(){
243		var wWidth = $( this ).width();
244		if( wWidth < 992 ){
245			var $exploreLinksTitle = $( '.nwp-explore-links .explore-menu-title' );
246			var $expTitles = $exploreLinksTitle.find( '.col-lg-6' ).children();
247			
248			var $exploreLinksCol = $( '.nwp-explore-links .explore-menu-item-lists' );
249
250			console.log( $expTitles );
251			for( let i=0; i < $exploreLinksCol.length; i++ ){
252				$( $exploreLinksCol.get(i) ).find( '.col-lg-2' ).prepend( $( $expTitles.get(i) ).find('h6') );
253				console.log(i);
254			}
255		}
256	}); */
257	// Header Sticky
258	$(window).on('scroll',function() {
259		if ($(this).scrollTop() > 120){  
260			$('.navbar-area').addClass("is-sticky");
261		}
262		else{
263			$('.navbar-area').removeClass("is-sticky");
264		}
265	});
266
267	// Mean Menu
268	jQuery('.mean-menu').meanmenu({
269		meanScreenWidth: "1199"
270	});
271	
272	// Others Option For Responsive JS
273	$(".others-option-for-responsive .dot-menu").on("click", function(){
274		$(".others-option-for-responsive .container .container").toggleClass("active");
275	});
276
277	// News Gallery Slide
278	$('.news-gallery-slide').owlCarousel({
279		loop: true,
280		nav: true,
281		dots: false,
282		autoplayHoverPause: true,
283		autoplay: true,
284		margin: 30,
285		navText: [
286			"<i class='bx bx-chevron-left bx-2-green'></i>",
287			"<i class='bx bx-chevron-right bx-2-green'></i>"
288		],
289		responsive: {
290			0: {
291				items: 1,
292			},
293			576: {
294				items: 1,
295			},
296			768: {
297				items: 1,
298			},
299			1200: {
300				items: 1,
301			}
302		}
303	});
304
305	// Video Slides
306	$('.video-slides').owlCarousel({
307		loop: true,
308		nav: true,
309		dots: false,
310		autoplayHoverPause: true,
311		autoplay: true,
312		margin: 30,
313		navText: [
314			"<i class='bx bx-chevron-left'></i>",
315			"<i class='bx bx-chevron-right'></i>"
316		],
317		responsive: {
318			0: {
319				items: 1,
320			},
321			576: {
322				items: 1,
323			},
324			768: {
325				items: 2,
326			},
327			1200: {
328				items: 2,
329			}
330		}
331	});
332	
333
334	// Popup Video
335	$('.popup-youtube').magnificPopup({
336		disableOn: 320,
337		type: 'iframe',
338		mainClass: 'mfp-fade',
339		removalDelay: 160,
340		preloader: false,
341		fixedContentPos: false
342	});
343	
344	// Sector Icons
345	$('.home-projects-grid').owlCarousel({
346		loop: true,
347		nav: true,
348		dots: false,
349		autoplayHoverPause: true,
350		autoplay: true,
351		margin: 30,
352		navText: [
353			"<i class='bx bx-2-green bx-chevron-left'></i>",
354			"<i class='bx bx-2-green bx-chevron-right'></i>"
355		],
356		responsive: {
357			0: {
358				items: 1,
359			},
360			576: {
361				items: 3,
362			},
363			768: {
364				items: 5,
365			},
366			1200: {
367				items: 5,
368			}
369		}
370	});
371
372	// Sector Icons
373	$('.home-projects2-grid').owlCarousel({
374		loop: true,
375		nav: true,
376		dots: false,
377		autoplayHoverPause: true,
378		autoplay: true,
379		margin: 30,
380		navText: [
381			"<i class='bx bx-chevron-left'></i>",
382			"<i class='bx bx-chevron-right'></i>"
383		],
384		responsive: {
385			0: {
386				items: 2,
387			},
388			576: {
389				items: 3,
390			},
391			768: {
392				items: 4,
393			},
394			1200: {
395				items: 5,
396			}
397		}
398	});
399
400	// Business News Slides
401	$('.business-news-slides').owlCarousel({
402		loop: true,
403		nav: true,
404		dots: false,
405		autoplayHoverPause: true,
406		autoplay: true,
407		margin: 30,
408		navText: [
409			"<i class='bx bx-chevron-left'></i>",
410			"<i class='bx bx-chevron-right'></i>"
411		],
412		responsive: {
413			0: {
414				items: 1,
415			},
416			576: {
417				items: 1,
418			},
419			768: {
420				items: 2,
421			},
422			1200: {
423				items: 2,
424			}
425		}
426	});
427	// Home News Slide
428	$('.nwp-all-news').owlCarousel({
429		loop: true,
430		nav: true,
431		dots: false,
432		autoplayHoverPause: true,
433		autoplay: true,
434		margin: 30,
435		navText: [
436			"<i class='bx bx-2-green bx-chevron-left'></i>",
437			"<i class='bx bx-2-green bx-chevron-right'></i>"
438		],
439		responsive: {
440			0: {
441				items: 1,
442			},
443			576: {
444				items: 1,
445			},
446			768: {
447				items: 2,
448			},
449			1200: {
450				items: 3,
451			}
452		}
453	});
454
455	// Mulitmedia Slide
456	$('.multimedia-slide').owlCarousel({
457		loop: true,
458		nav: true,
459		dots: false,
460		autoplayHoverPause: true,
461		autoplay: true,
462		margin: 30,
463		navText: [
464			"<i class='bx bx-2-green bx-chevron-left'></i>",
465			"<i class='bx bx-2-green bx-chevron-right'></i>"
466		],
467		responsive: {
468			0: {
469				items: 1,
470			},
471			576: {
472				items: 1,
473			},
474			768: {
475				items: 2,
476			},
477			1200: {
478				items: 2,
479			}
480		}
481	});
482
483	// Health News Slides
484	$('.health-news-slides').owlCarousel({
485		loop: true,
486		nav: true,
487		dots: false,
488		autoplayHoverPause: true,
489		autoplay: true,
490		margin: 30,
491		navText: [
492			"<i class='bx bx-chevron-left'></i>",
493			"<i class='bx bx-chevron-right'></i>"
494		],
495		responsive: {
496			0: {
497				items: 1,
498			},
499			576: {
500				items: 1,
501			},
502			768: {
503				items: 2,
504			},
505			1200: {
506				items: 2,
507			}
508		}
509	});
510
511	// Subscribe form
512	$(".newsletter-form").validator().on("submit", function (event) {
513		if (event.isDefaultPrevented()) {
514		// handle the invalid form...
515			formErrorSub();
516			submitMSGSub(false, "Please enter your email correctly.");
517		} else {
518			// everything looks good!
519			event.preventDefault();
520		}
521	});
522	function callbackFunction (resp) {
523		if (resp.result === "success") {
524			formSuccessSub();
525		}
526		else {
527			formErrorSub();
528		}
529	}
530	function formSuccessSub(){
531		$(".newsletter-form")[0].reset();
532		submitMSGSub(true, "Thank you for subscribing!");
533		setTimeout(function() {
534			$("#validator-newsletter").addClass('hide');
535		}, 4000)
536	}
537	function formErrorSub(){
538		$(".newsletter-form").addClass("animated shake");
539		setTimeout(function() {
540			$(".newsletter-form").removeClass("animated shake");
541		}, 1000)
542	}
543	function submitMSGSub(valid, msg){
544		if(valid){
545			var msgClasses = "validation-success";
546		} else {
547			var msgClasses = "validation-danger";
548		}
549		$("#validator-newsletter").removeClass().addClass(msgClasses).text(msg);
550	}
551	// AJAX MailChimp
552	$(".newsletter-form").ajaxChimp({
553		url: "https://envytheme.us20.list-manage.com/subscribe/post?u=60e1ffe2e8a68ce1204cd39a5&amp;id=42d6d188d9", // Your url MailChimp
554		callback: callbackFunction
555	});
556
557	// Go to Top
558	$(function(){
559		// Scroll Event
560		$(window).on('scroll', function(){
561			var scrolled = $(window).scrollTop();
562			if (scrolled > 600) $('.go-top').addClass('active');
563			if (scrolled < 600) $('.go-top').removeClass('active');
564		});  
565		// Click Event
566		$('.go-top').on('click', function() {
567			$("html, body").animate({ scrollTop: "0" },  500);
568		});
569	});
570
571	/* // Sports Slides
572	$('.sports-slider').owlCarousel({
573		loop: true,
574		nav: true,
575		dots: false,
576		autoplayHoverPause: true,
577		autoplay: true,
578		items: 1,
579		margin: 30,
580		navText: [
581			"<i class='bx bx-chevron-left'></i>",
582			"<i class='bx bx-chevron-right'></i>"
583		],
584		
585		responsive: {
586			0: {
587				items: 1,
588			},
589			576: {
590				items: 2,
591			},
592			768: {
593				items: 1,
594			},
595			1200: {
596				items: 1,
597			}
598		}
599	});
600	
601	// Tech Slides
602	$('.tech-slider').owlCarousel({
603		loop: true,
604		nav: true,
605		dots: false,
606		autoplayHoverPause: true,
607		autoplay: true,
608		items: 1,
609		margin: 30,
610		navText: [
611			"<i class='bx bx-chevron-left'></i>",
612			"<i class='bx bx-chevron-right'></i>"
613		],
614		
615		responsive: {
616			0: {
617				items: 1,
618			},
619			576: {
620				items: 2,
621			},
622			768: {
623				items: 1,
624			},
625			1200: {
626				items: 1,
627			}
628		}
629	});
630
631	// Breaking News Slides
632	$('.breaking-news-slides').owlCarousel({
633		loop: true,
634		nav: false,
635		dots: false,
636		autoplayHoverPause: true,
637		autoplay: true,
638		animateOut:"slideOutDown",
639		animateIn:"flipInX",
640		items: 1,
641		margin: 30,
642		navText: [
643			"<i class='bx bx-chevron-left'></i>",
644			"<i class='bx bx-chevron-right'></i>"
645		],
646	});
647	
648	// Main News Slides
649	$('.main-news-slides').owlCarousel({
650		loop: true,
651		nav: true,
652		dots: false,
653		autoplayHoverPause: true,
654		autoplay: true,
655		margin: 30,
656		navText: [
657			"<i class='bx bx-chevron-left'></i>",
658			"<i class='bx bx-chevron-right'></i>"
659		],
660		responsive: {
661			0: {
662				items: 1,
663			},
664			576: {
665				items: 1,
666			},
667			768: {
668				items: 2,
669			},
670			1200: {
671				items: 3,
672			}
673		}
674	});
675	
676	// Top Stories Slid
677	$('.top-stories-slide').owlCarousel({
678		loop: true,
679		nav: false,
680		dots: false,
681		autoplayHoverPause: true,
682		autoplayTimeout: 3000,
683		autoplay: true,
684		margin: 30,
685		navText: [
686			"<i class='bx bx-chevron-left'></i>",
687			"<i class='bx bx-chevron-right'></i>"
688		],
689		responsive: {
690			0: {
691				items: 1,
692			},
693			576: {
694				items: 1,
695			},
696			768: {
697				items: 1,
698			},
699			1200: {
700				items: 1,
701			}
702		}
703	});
704	
705	*/
706	// Institutions and agencies Slide
707	$('.ia-slide').owlCarousel({
708		loop: true,
709		nav: false,
710		dots: false,
711		autoplayHoverPause: true,
712		autoplay: true,
713		margin: 30,
714		navText: [
715			"<i class='bx bx-chevron-left'></i>",
716			"<i class='bx bx-chevron-right'></i>"
717		],
718		responsive: {
719			0: {
720				items: 1,
721			},
722			576: {
723				items: 2,
724			},
725			768: {
726				items: 2,
727			},
728			1200: {
729				items: 3,
730			}
731		}
732	});
733	// FAQ Accordion
734	$(function() {
735		$('.accordion').find('.accordion-title').on('click', function(){
736			// Adds Active Class
737			$(this).toggleClass('active');
738			// Expand or Collapse This Panel
739			$(this).next().slideToggle('fast');
740			// Hide The Other Panels
741			$('.accordion-content').not($(this).next()).slideUp('fast');
742			// Removes Active Class From Other Titles
743			$('.accordion-title').not($(this)).removeClass('active');		
744		});
745	});
746
747	// Nice Select JS
748	$('select').niceSelect();
749
750	// Count Time 
751	function makeTimer() {
752		var endTime = new Date("September 20, 3000 17:00:00 PDT");
753		
754		var endTime = new Date( $("#timer").attr("data-event") + " 10:00:00 GMT");
755		var endTime = (Date.parse(endTime)) / 1000;
756		var now = new Date();
757		var now = (Date.parse(now) / 1000);
758		var timeLeft = endTime - now;
759		var days = Math.floor(timeLeft / 86400); 
760		var hours = Math.floor((timeLeft - (days * 86400)) / 3600);
761		var minutes = Math.floor((timeLeft - (days * 86400) - (hours * 3600 )) / 60);
762		var seconds = Math.floor((timeLeft - (days * 86400) - (hours * 3600) - (minutes * 60)));
763		if (hours < "10") { hours = "0" + hours; }
764		if (minutes < "10") { minutes = "0" + minutes; }
765		if (seconds < "10") { seconds = "0" + seconds; }
766		$("#days").html(days + "<span>Days</span>");
767		$("#hours").html(hours + "<span>Hours</span>");
768		$("#minutes").html(minutes + "<span>Minutes</span>");
769		$("#seconds").html(seconds + "<span>Seconds</span>");
770	}
771	setInterval(function() { makeTimer(); }, 0);
772	
773	// Preloader
774	/* $(window).on('load', function() {
775		$('.preloader').fadeOut();
776		$('.preloader-area').addClass('preloader-deactivate');
777	}); */
778
779}(jQuery));

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.