(function ($) { 'use strict'; jQuery(document).ready(function () { /* * ---------------------------------------------------------------------------------------- * PRELOADER JS * ---------------------------------------------------------------------------------------- */ $(window).on("load", function () { $('.spinner').fadeOut(); $('.preloader-area').delay(350).fadeOut('slow'); }); /* * ---------------------------------------------------------------------------------------- * CHANGE MENU BACKGROUND JS * ---------------------------------------------------------------------------------------- */ $(window).on('scroll', function () { if ($(window).scrollTop() > 200) { $('.header-top-area').addClass('menu-bg'); } else { $('.header-top-area').removeClass('menu-bg'); } }); /* * ---------------------------------------------------------------------------------------- * SMOTH SCROOL JS * ---------------------------------------------------------------------------------------- */ $('a.smoth-scroll').on("click", function (e) { var anchor = $(this); $('html, body').stop().animate({ scrollTop: $(anchor.attr('href')).offset().top - 50 }, 1000); e.preventDefault(); }); /* * ---------------------------------------------------------------------------------------- * MAGNIFIC POPUP JS * ---------------------------------------------------------------------------------------- */ var magnifPopup = function () { $('.work-popup').magnificPopup({ type: 'image', removalDelay: 300, mainClass: 'mfp-with-zoom', gallery: { enabled: true }, zoom: { enabled: true, // By default it's false, so don't forget to enable it duration: 300, // duration of the effect, in milliseconds easing: 'ease-in-out', // CSS transition easing function // The "opener" function should return the element from which popup will be zoomed in // and to which popup will be scaled down // By defailt it looks for an image tag: opener: function (openerElement) { // openerElement is the element on which popup was initialized, in this case its tag // you don't need to add "opener" option if this code matches your needs, it's defailt one. return openerElement.is('img') ? openerElement : openerElement.find('img'); } } }); }; // Call the functions magnifPopup(); /* * ---------------------------------------------------------------------------------------- * PARALLAX JS * ---------------------------------------------------------------------------------------- */ $(window).stellar({ responsive: true, positionProperty: 'position', horizontalScrolling: false }); /* * ---------------------------------------------------------------------------------------- * COUNTER UP JS * ---------------------------------------------------------------------------------------- */ $('.counter-num').counterUp(); /* * ---------------------------------------------------------------------------------------- * SLICK NAV UP JS * ---------------------------------------------------------------------------------------- */ $("ul#navigation").slicknav({ prependTo: ".responsive-menu-wrap" }); /* * ---------------------------------------------------------------------------------------- * USER & SCREENSHOTS JS * ---------------------------------------------------------------------------------------- */ $(".testimonial-list").owlCarousel({ items: 3, autoPlay: true, navigation: false, itemsDesktop: [1199, 1], itemsDesktopSmall: [980, 2], itemsTablet: [768, 2], itemsTabletSmall: false, itemsMobile: [479, 1], pagination: true, autoHeight: true, }); /* * ---------------------------------------------------------------------------------------- * USER & SCREENSHOTS JS * ---------------------------------------------------------------------------------------- */ $(".blog-list").owlCarousel({ items: 3, autoPlay: true, navigation: false, itemsDesktop: [1199, 1], itemsDesktopSmall: [980, 2], itemsTablet: [768, 2], itemsTabletSmall: false, itemsMobile: [479, 1], pagination: true, autoHeight: true, }); /* * ---------------------------------------------------------------------------------------- * GOOGLE MAP JS * ---------------------------------------------------------------------------------------- */ /*var myCenter = new google.maps.LatLng(32.950547, -96.833707); function initialize() { var mapProp = { zoom: 14, center: myCenter, scrollwheel: false, styles: [{ "stylers": [{ "hue": "#ffffff" }, { saturation: -110 }, { gamma: 2 }] }], mapTpeIdy: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map"), mapProp); } google.maps.event.addDomListener(window, 'load', initialize);*/ /* * ---------------------------------------------------------------------------------------- * EXTRA JS * ---------------------------------------------------------------------------------------- */ $(document).on('click', '.navbar-collapse.in', function (e) { if ($(e.target).is('a') && $(e.target).attr('class') != 'dropdown-toggle') { $(this).collapse('hide'); } }); $('body').scrollspy({ target: '.navbar-collapse', offset: 195 }); /* * ---------------------------------------------------------------------------------------- * SCROOL TO UP JS * ---------------------------------------------------------------------------------------- */ $(window).on("scroll", function () { if ($(this).scrollTop() > 250) { $('.scrollup').fadeIn(); } else { $('.scrollup').fadeOut(); } }); $('.scrollup').on("click", function () { $("html, body").animate({ scrollTop: 0 }, 800); return false; }); /* * ---------------------------------------------------------------------------------------- * WOW JS * ---------------------------------------------------------------------------------------- */ new WOW().init(); }); })(jQuery);