;(function($){ "use strict" var nav_offset_top = $('header').height() + 50; /*------------------------------------------------------------------------------- Navbar -------------------------------------------------------------------------------*/ //* Navbar Fixed function navbarFixed(){ if ( $('.header_area').length ){ $(window).scroll(function() { var scroll = $(window).scrollTop(); if (scroll >= nav_offset_top ) { $(".header_area").addClass("navbar_fixed"); } else { $(".header_area").removeClass("navbar_fixed"); } }); }; }; navbarFixed(); /*----------------------------------------------------*/ /* Parallax Effect js /*----------------------------------------------------*/ function parallaxEffect() { $('.bg-parallax').parallax(); } parallaxEffect(); if(document.getElementById("number-section")){ $('.counter').counterUp({ delay: 10, time: 1000 }); } //------- Owl Carusel js --------// $(document).ready(function() { $('.play-video').magnificPopup({ disableOn: 700, type: 'iframe', mainClass: 'mfp-fade', removalDelay: 160, preloader: false, fixedContentPos: false }); // Search Toggle $("#search_input_box").hide(); $("#search").on("click", function () { $("#search_input_box").slideToggle(); $("#search_input").focus(); }); $("#close_search").on("click", function () { $('#search_input_box').slideUp(500); }); }); // Header scroll class $(window).scroll(function() { if ($(this).scrollTop() > 100) { $('#header').addClass('header-scrolled'); } else { $('#header').removeClass('header-scrolled'); } }); //------- mailchimp --------// function mailChimp() { $('#mc_embed_signup').find('form').ajaxChimp(); } mailChimp(); //-------- Counter js --------// $(window).on("load", function() { $('.portfolio-filter ul li').on('click', function () { $('.portfolio-filter ul li').removeClass('active'); $(this).addClass('active'); var data = $(this).attr('data-filter'); $workGrid.isotope({ filter: data }); }); if (document.getElementById('portfolio')) { var $workGrid = $('.portfolio-grid').isotope({ itemSelector: '.all', percentPosition: true, masonry: { columnWidth: '.grid-sizer' } }); } }); })(jQuery)