1(function ($) { 2 "use strict"; 3 4 // Preloader (if the #preloader div exists) 5 $(window).on('load', function () { 6 if ($('#preloader').length) { 7 $('#preloader').delay(100).fadeOut('slow', function () { 8 $(this).remove(); 9 }); 10 } 11 }); 12 13 // Back to top button 14 $(window).scroll(function() { 15 if ($(this).scrollTop() > 100) { 16 $('.back-to-top').fadeIn('slow'); 17 } else { 18 $('.back-to-top').fadeOut('slow'); 19 } 20 }); 21 $('.back-to-top').click(function(){ 22 $('html, body').animate({scrollTop : 0},1500, 'easeInOutExpo'); 23 return false; 24 }); 25 26 // Initiate the wowjs animation library 27 new WOW().init(); 28 29 // Header scroll class 30 $(window).scroll(function() { 31 if ($(this).scrollTop() > 100) { 32 $('#header').addClass('header-scrolled'); 33 } else { 34 $('#header').removeClass('header-scrolled'); 35 } 36 }); 37 38 if ($(window).scrollTop() > 100) { 39 $('#header').addClass('header-scrolled'); 40 } 41 42 // Smooth scroll for the navigation and links with .scrollto classes 43 $('.main-nav a, .mobile-nav a, .scrollto').on('click', function() { 44 if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { 45 var target = $(this.hash); 46 if (target.length) { 47 var top_space = 0; 48 49 if ($('#header').length) { 50 top_space = $('#header').outerHeight(); 51 52 if (! $('#header').hasClass('header-scrolled')) { 53 top_space = top_space - 40; 54 } 55 } 56 57 $('html, body').animate({ 58 scrollTop: target.offset().top - top_space 59 }, 1500, 'easeInOutExpo'); 60 61 if ($(this).parents('.main-nav, .mobile-nav').length) { 62 $('.main-nav .active, .mobile-nav .active').removeClass('active'); 63 $(this).closest('li').addClass('active'); 64 } 65 66 if ($('body').hasClass('mobile-nav-active')) { 67 $('body').removeClass('mobile-nav-active'); 68 $('.mobile-nav-toggle i').toggleClass('fa-times fa-bars'); 69 $('.mobile-nav-overly').fadeOut(); 70 } 71 return false; 72 } 73 } 74 }); 75 76 // Navigation active state on scroll 77 var nav_sections = $('section'); 78 var main_nav = $('.main-nav, .mobile-nav'); 79 var main_nav_height = $('#header').outerHeight(); 80 81 $(window).on('scroll', function () { 82 var cur_pos = $(this).scrollTop(); 83 84 nav_sections.each(function() { 85 var top = $(this).offset().top - main_nav_height, 86 bottom = top + $(this).outerHeight(); 87 88 if (cur_pos >= top && cur_pos <= bottom) { 89 main_nav.find('li').removeClass('active'); 90 main_nav.find('a[href="#'+$(this).attr('id')+'"]').parent('li').addClass('active'); 91 } 92 }); 93 }); 94 95 // jQuery counterUp (used in Whu Us section) 96 $('[data-toggle="counter-up"]').counterUp({ 97 delay: 10, 98 time: 1000 99 }); 100 101 // Porfolio isotope and filter 102 $(window).on('load', function () { 103 var portfolioIsotope = $('.portfolio-container').isotope({ 104 itemSelector: '.portfolio-item' 105 }); 106 $('#portfolio-flters li').on( 'click', function() { 107 $("#portfolio-flters li").removeClass('filter-active'); 108 $(this).addClass('filter-active'); 109 110 portfolioIsotope.isotope({ filter: $(this).data('filter') }); 111 }); 112 }); 113 114 // Testimonials carousel (uses the Owl Carousel library) 115 $(".testimonials-carousel").owlCarousel({ 116 autoplay: true, 117 dots: true, 118 loop: true, 119 items: 1 120 }); 121 122 // Clients carousel (uses the Owl Carousel library) 123 $(".clients-carousel").owlCarousel({ 124 autoplay: true, 125 dots: true, 126 loop: true, 127 responsive: { 0: { items: 2 }, 768: { items: 4 }, 900: { items: 6 } 128 } 129 }); 130 131})(jQuery); 132
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.