/*----------------------------------------------------------------------------------- /* /* Init JS /* -----------------------------------------------------------------------------------*/ jQuery(document).ready(function() { $WIN = $(window); /* Preloader * -------------------------------------------------- */ var Preloader = function() { $WIN.on('load', function() { // will first fade out the loading animation $("#loader").fadeOut("slow", function() { // will fade out the whole DIV that covers the website. $("#preloader").delay(300).fadeOut("slow"); }); }); }; $('.customer-logos').slick({ slidesToShow: 8, slidesToScroll: 4, autoplay: true, autoplaySpeed: 5000, arrows: false, dots: false, pauseOnHover: false, responsive: [{ breakpoint: 768, settings: { slidesToShow: 4 } }, { breakpoint: 480, settings: { slidesToScroll: 2, slidesToShow: 2 } }] }); //------- Custom Arrows click functionality $(document).on('click', '.prevSlide', function() { $('.customer-logos').slick('slickPrev'); }); $(document).on('click', '.nextSlide', function() { $('.customer-logos').slick('slickNext'); }); /*----------------------------------------------------*/ /* Flexslider /*----------------------------------------------------*/ $('#about-slider').flexslider({ animation: 'fade', controlNav: true, directionNav: false, touch: true, }); /*----------------------------------------------------*/ /* Adjust Primary Navigation Background Opacity ------------------------------------------------------*/ $(window).on('scroll', function() { var h = $('header').height(); var y = $(window).scrollTop(); var header = $('#main-header'); if ((y > h + 30) && ($(window).outerWidth() > 1024)) { header.addClass('opaque'); } else { if (y < h + 30) { header.removeClass('opaque'); } else { header.addClass('opaque'); } } }); /* superfish * -------------------------------------------------- */ var SuperFish = function() { $('ul.sf-menu').superfish({ animation: { height: 'show' }, // slide-down effect without fade-in animationOut: { height: 'hide' }, // slide-up effect without fade-in cssArrows: false, // disable css arrows delay: 600, // .6 second delay on mouseout speed: 'fast', }); }; /* Mobile Menu ------------------------------------------------------ */ var MobileNav = function() { var toggleButton = $('.menu-toggle'), nav = $('.main-navigation'); toggleButton.on('click', function(event) { event.preventDefault(); toggleButton.toggleClass('is-clicked'); nav.slideToggle(); }); if (toggleButton.is(':visible')) nav.addClass('mobile'); $WIN.resize(function() { if (toggleButton.is(':visible')) nav.addClass('mobile'); else nav.removeClass('mobile'); }); $('#main-nav-wrap li a').on("click", function() { if (nav.hasClass('mobile')) { toggleButton.toggleClass('is-clicked'); nav.fadeOut(); } }); $('#main-nav-wrap > ul.mobile >li.has-children').append('