/** * * -------------------------------------------------------------------- * * Template : elevate - Consulting Business WordPress Theme * -------------------------------------------------------------------- * **/ (function($) { "use strict"; // sticky menu var header = $('.menu-sticky'); var win = $(window); var headerinnerHeight = $(".header-inner").innerHeight(); win.on('scroll', function() { var scroll = win.scrollTop(); if (scroll < headerinnerHeight) { header.removeClass("sticky"); $('.menu-area').removeClass("sticky-menu"); } else { header.addClass("sticky"); $('.menu-area').addClass("sticky-menu"); } }); $('.header-inner').waypoint('sticky', { offset: 0 }); $(".widget_nav_menu li a").filter(function(){ return $.trim($(this).html()) == ''; }).hide(); // collapse hidden $(function(){ var navMain = $(".navbar-collapse"); // avoid dependency on #id // when you have dropdown inside navbar navMain.on("click", "a:not([data-toggle])", null, function () { navMain.collapse('hide'); }); }); // video if ($('.player').length) { $(".player").YTPlayer(); } $(".menu-area .navbar ul > li.menu-item-has-children").hover( function () { $(this).addClass('hover-minimize'); }, function () { $(this).removeClass("hover-minimize"); } ); $( ".showcase-item" ).hover(function() { $( this ).toggleClass("hover"); }); if($('.progress-wrap').length){ $(document).ready(function(){ var progressPath = document.querySelector('.progress-wrap path'); var pathLength = progressPath.getTotalLength(); progressPath.style.transition = progressPath.style.WebkitTransition = 'none'; progressPath.style.strokeDasharray = pathLength + ' ' + pathLength; progressPath.style.strokeDashoffset = pathLength; progressPath.getBoundingClientRect(); progressPath.style.transition = progressPath.style.WebkitTransition = 'stroke-dashoffset 10ms linear'; var updateProgress = function () { var scroll = $(window).scrollTop(); var height = $(document).height() - $(window).height(); var progress = pathLength - (scroll * pathLength / height); progressPath.style.strokeDashoffset = progress; } updateProgress(); $(window).scroll(updateProgress); var offset = 50; var duration = 550; jQuery(window).on('scroll', function() { if (jQuery(this).scrollTop() > offset) { jQuery('.progress-wrap').addClass('active-progress'); } else { jQuery('.progress-wrap').removeClass('active-progress'); } }); jQuery('.progress-wrap').on('click', function(event) { event.preventDefault(); jQuery('html, body').animate({scrollTop: 0}, duration); return false; }) }); } //Phone Number $('.phone_call').on('click', function(event) { $('.phone_num_call').slideToggle('show'); }); //search $('.sticky_search').on('click', function(event) { $('.sticky_form').animate({ opacity: 'toggle' }, 500);; $( '.sticky_form input' ).focus(); }); $('.sticky_search').on('click', function() { $('body').removeClass('search-active').removeClass('search-close'); if ($(this).hasClass('close-full')) { $('body').addClass('search-close'); $('.sticky_form').fadeOut('show'); } else { $('body').addClass('search-active'); } return false; }); $('.nav-link-container').on('click', function(e){ $('body.on-offcanvas').removeClass('on-offcanvas'); setTimeout(function(){ $('body').addClass('on-offcanvas'); },500); }); if($('.reactheme-newsletter').hasClass('reactheme-newsletters')){ $('body').addClass('reactheme-pages-btm-gap'); } $('.sticky_form_search').on('click', function() { $('body, html').removeClass('reactheme-search-active').removeClass('reactheme-search-close'); if ($(this).hasClass('close-search')) { $('body, html').addClass('reactheme-search-close'); } else { $('body, html').addClass('reactheme-search-active'); } return false; }); if($('#reactheme-header').hasClass('fixed-menu')){ $('body').addClass('body-left-space'); } $("#reactheme-header ul > li.classic").hover( function () { $('body').addClass('mega-classic'); }, function () { $('body.mega-classic').removeClass("mega-classic"); } ); var nav = $('#nav'); if(nav.length){ $('#menu-single-menu').onePageNav(); } new WOW().init(); $(document).ready(function(){ function resizeNav() { $(".menu-ofcn").css({"height": window.innerHeight}); var radius = Math.sqrt(Math.pow(window.innerHeight, 2) + Math.pow(window.innerWidth, 2)); var diameter = radius * 2; $(".off-nav-layer").width(diameter); $(".off-nav-layer").height(diameter); $(".off-nav-layer").css({"margin-top": -radius, "margin-left": -radius}); } $(".menu-button, .close-button").on('click', function() { $(".nav-toggle, .off-nav-layer, .menu-ofcn, .close-button, body").toggleClass("off-open"); }); $(window).resize(resizeNav); resizeNav(); }); // Canvas Menu Js $( ".nav-link-container > a" ).off("click").on("click", function(event){ event.preventDefault(); $(".nav-link-container").toggleClass("nav-inactive-menu-link-container"); $(".mobile-menus").toggleClass("nav-active-menu-container"); }); // Get a quote popup $('.popup-quote').magnificPopup({ type: 'inline', preloader: false, focus: '#qname', removalDelay: 500, //delay removal by X to allow out-animation // When elemened is focused, some mobile browsers in some cases zoom in // It looks not nice, so we disable it: callbacks: { beforeOpen: function() { this.st.mainClass = this.st.el.attr('data-effect'); if($(window).width() < 700) { this.st.focus = false; } else { this.st.focus = '#qname'; } } } }); // Canvas Menu Js $( ".nav-link-container > a" ).off("click").on("click", function(event){ event.preventDefault(); $(".nav-link-container").toggleClass("nav-inactive-menu-link-container"); $(".mobile-menus").toggleClass("nav-active-menu-container"); }); $(".nav-close-menu-li > a").on('click', function(event){ $(".mobile-menus").toggleClass("nav-active-menu-container"); $(".content").toggleClass("inactive-body"); }); $(".reactheme-heading h3").each(function() { // Some Vars var elText, openSpan = '', closeSpan = ''; // Make the text into array elText = $(this).text().split(" "); // Adding the open span to the beginning of the array elText.unshift(openSpan); // Adding span closing after the first word in each sentence elText.splice(2, 0, closeSpan); // Make the array into string elText = elText.join(" "); // Change the html of each element to style it $(this).html(elText); }); $(function(){ $( "ul.children" ).addClass( "sub-menu" ); }); $(".reactheme-products-grid .product-btn .button").addClass("glyph-icon flaticon-shopping-bag"); //Videos popup jQuery activation code $('.popup-videos').magnificPopup({ disableOn: 10, type: 'iframe', mainClass: 'mfp-fade', removalDelay: 160, preloader: false, fixedContentPos: false }); // collapse hidden $(function(){ var navMain = $(".navbar-collapse"); // avoid dependency on #id // "a:not([data-toggle])" - to avoid issues caused // when you have dropdown inside navbar navMain.on("click", "a:not([data-toggle])", null, function () { navMain.collapse('hide'); }); }); //Select box wrap css $(".menu-area .navbar ul > li.mega > ul.sub-menu").wrapInner("
"); $('.menu-area .navbar ul > li.mega > ul.sub-menu li').first().addClass('first-li-item'); if ($('div').hasClass('openingfoot')) { $('body').addClass('openingfootwrap'); } //preloader $(window).on( 'load', function() { $("#elevate-load").delay(500).fadeOut(200); $(".elevate-loader").delay(500).fadeOut(200); if($(window).width() < 992) { $('.reactheme-menu').css('height', '0'); $('.reactheme-menu').css('opacity', '0'); $('.reactheme-menu').css('z-index', '-1'); $('.reactheme-menu-toggle').on( 'click', function(){ $('.reactheme-menu').css('opacity', '1'); $('.reactheme-menu').css('z-index', '1'); }); } }) // magnificPopup init $('.image-popup').magnificPopup({ type: 'image', callbacks: { beforeOpen: function() { this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure animated zoomInDown'); } }, image: { tError: 'The image #%curr% could not be loaded.', titleSrc: function(item) { return '' + item.el.attr('caption') + '