/*============================================================ # template name: loxicat - business consulting html5 template # template uri: https://webextheme.com/html/loxicat-html/ # description: business consulting html5 template # author: loxicat # author uri: https://themeforest.net/user/webextheme # version: 1.0 /*============================================================ /*======================================== ---------- [js_indexing_start] ----------- ========================================== ## [_prealoder_default] ## [_sticky_header] ## [_side_panel_start] ## [_mobile_menu_start] ## [_progress_bar] ## [_toggle_search_box] ## [_back_to_top] ## [_accordion] ## [_owl_carousel] ## [_home_carousel] ## [_testimonial_items_1col] ## [_testimonial_items_2col] ## [_testimonial_items_3col] ## [_team_items_5col] ## [_team_items_3col] ## [_project_items_5col] ## [_client_items] ## [_language_button] ## [_inline_data_attribute] ## [_magnificpopup] ## [_portfolio_filter] ## [_counterup] ## [_wow] ========================================== --------- [js_indexing_end] -------------- ========================================== */ (function($) { "use strict"; var wind = $(window); var jqwind = jquery(window); var jqdoc = jquery(document); // ===prealoder=== function prealoader() { if ($('.preloader').length) { $('.preloader').delay(100).fadeout(500); } } /*=============================================*/ /*-------------- [_sticky_header] -------------*/ /*=============================================*/ wind.on('scroll', function() { var sticky_one_layer = $('.header-navigation-area.one-layer-header'); var sticky_two_layers = $('.header-navigation-area.two-layers-header'); var sticky_three_layers = $('.header-navigation-area.three-layers-header'); var scroll = wind.scrolltop(); if (scroll < 0) { sticky_one_layer.removeclass('fixed'); } else { sticky_one_layer.addclass('fixed'); } if (scroll < 36) { sticky_two_layers.removeclass('fixed'); } else { sticky_two_layers.addclass('fixed'); } if (scroll < 152) { sticky_three_layers.removeclass('fixed'); } else { sticky_three_layers.addclass('fixed'); } }); jquery(document).on('ready', function() { /*=============================================*/ /*----------- [_side_panel_start] -------------*/ /*=============================================*/ $('.side-panel-trigger').on('click', function() { $('.side-panel-content').addclass('side-panel-open'); }) $('.close-icon').on('click', function() { $('.side-panel-content').removeclass('side-panel-open'); }) /*=============================================*/ /*---------- [_mobile_menu_start] -------------*/ /*=============================================*/ var $mobile_menu = $('#mobile-menu'); var $mobile_menu_right = $('#mobile-menu-right'); $mobile_menu.meanmenu({ meanmenucontainer: '.mobile-menu', meanscreenwidth: "991", meanrevealposition: "left", }); $mobile_menu_right.meanmenu({ meanmenucontainer: '.mobile-menu-right', meanscreenwidth: "991", meanrevealposition: "right", }); /*=============================================*/ /*------------- [_progress_bar] ---------------*/ /*=============================================*/ if ($('.progress-line').length) { $('.progress-line').appear(function() { var el = $(this); var percent = el.data('width'); $(el).css('width', percent + '%'); }, { accy: 0 }); } if ($('.count-box').length) { $('.count-box').appear(function() { var $t = $(this), n = $t.find(".count-text").attr("data-stop"), r = parseint($t.find(".count-text").attr("data-speed"), 10); if (!$t.hasclass("counted")) { $t.addclass("counted"); $({ countnum: $t.find(".count-text").text() }).animate({ countnum: n }, { duration: r, easing: "linear", step: function() { $t.find(".count-text").text(math.floor(this.countnum)); }, complete: function() { $t.find(".count-text").text(this.countnum); } }); } }, { accy: 0 }); } /*=============================================*/ /*----------- [_toggle_search_box] ------------*/ /*=============================================*/ var $showsearchbox = $(".show-searchbox"); var $togglesearchbox = $(".toggle-searchbox"); $(document).on('click', function(e) { var clickid = e.target.id; if ((clickid !== 's')) { $togglesearchbox.removeclass('show'); } }); $showsearchbox.on('click', function(e) { event.stoppropagation(); }); $('.search-form').on('click', function(e) { event.stoppropagation(); }); $showsearchbox.on('click', function(e) { if (!$togglesearchbox.hasclass("show")) { $togglesearchbox.addclass('show'); event.preventdefault(); } else $togglesearchbox.removeclass('show'); event.preventdefault(); if (!$showsearchbox.hasclass("active")) $showsearchbox.addclass('active'); else $showsearchbox.removeclass('active'); }); /*=============================================*/ /*--------------- [_back_to_top] --------------*/ /*=============================================*/ $.scrollup({ scrollname: 'scrollup', // element id topdistance: '300', // distance from top before showing element (px) topspeed: 300, // speed back to top (ms) animation: 'fade', // fade, slide, none animationinspeed: 200, // animation in speed (ms) animationoutspeed: 200, // animation out speed (ms) scrolltext: '', // text for element activeoverlay: false, // set css color to display scrollup active point, e.g '#00ffff' }); /*=============================================*/ /*--------------- [_accordion] ----------------*/ /*=============================================*/ $('.accordion').find('.accordion-header').on('click', function() { // adds active class $(this).toggleclass('active'); // expand or collapse this panel $(this).next().slidetoggle(300, "swing"); // hide the other panels $('.accordion-body').not($(this).next()).slideup(300, "swing"); // removes active class from other titles $('.accordion-header').not($(this)).removeclass('active'); }); /*=============================================*/ /*------------- [_owl_carousel] ---------------*/ /*=============================================*/ /*------------- [_home_carousel] --------------*/ function home_carousel() { var owl = $(".home-carousel"); owl.owlcarousel({ loop:true, margin:0, nav:true, dots: false, animateout: 'fadeout', animatein: 'fadein', active: true, autoplay: false, video: true, smartspeed: 1000, autoplaytimeout: 8000, navtext: ["", ""], responsive: { 0: { items: 1 }, 425: { items: 1 }, 768: { items: 1 }, 1024: { items: 1 }, 1440: { items: 1 } } }); } home_carousel(); /*------------- [_welfare_items] --------------*/ function welfare_items() { var owl = $(".welfare_items"); owl.owlcarousel({ loop: true, margin: 0, autoplay: true, autoplaytimeout: 8000, nav: false, dots: true, navtext: ["", ""], responsive: { 0: { items: 1 }, 425: { items: 1 }, 768: { items: 1 }, 1024: { items: 1 }, 1440: { items: 1 } } }); } welfare_items(); /*------------- [_testimonial_items_1col] ------*/ function testimonial_items_1col() { var owl = $(".testimonial-items-1col"); owl.owlcarousel({ loop: true, margin: 30, autoplay: true, autoplaytimeout: 8000, nav: true, dots: true, navtext: ["", ""], responsive: { 0: { items: 1 }, 425: { items: 1 }, 768: { items: 1 }, 1024: { items: 2 }, 1440: { items: 1 } } }); } testimonial_items_1col(); /*------------- [_testimonial_items_2col] ------*/ function testimonial_items_2col() { var owl = $(".testimonial-items-2col"); owl.owlcarousel({ loop: true, margin: 30, autoplay: false, autoplaytimeout: 8000, nav: true, dots: false, navtext: ["", ""], responsive: { 0: { items: 1 }, 425: { items: 1 }, 768: { items: 1 }, 1024: { items: 2 }, 1440: { items: 2 } } }); } testimonial_items_2col(); /*------------- [_testimonial_items_3col] ------*/ function testimonial_items_3col() { var owl = $(".testimonial-items-3col"); owl.owlcarousel({ loop: true, margin: 30, autoplay: false, autoplaytimeout: 8000, nav: true, dots: false, navtext: ["", ""], responsive: { 0: { items: 1 }, 425: { items: 1 }, 768: { items: 2 }, 1024: { items: 2 }, 1440: { items: 3 } } }); } testimonial_items_3col(); /*------------- [_team_items_3col] ------*/ function team_items_3col() { var owl = $(".team-items-3col"); owl.owlcarousel({ loop: true, margin: 30, autoplay: true, autoplaytimeout: 8000, nav: true, dots: false, navtext: ["", ""], responsive: { 0: { items: 1 }, 425: { items: 1 }, 768: { items: 2 }, 1024: { items: 3 }, 1440: { items: 3 } } }); } team_items_3col(); /*------------- [_team_items_5col] ------*/ function team_items_5col() { var owl = $(".team-items-5col"); owl.owlcarousel({ loop: true, margin: 30, autoplay: true, autoplaytimeout: 8000, nav: true, dots: false, navtext: ["", ""], responsive: { 0: { items: 1 }, 425: { items: 2 }, 768: { items: 3 }, 1024: { items: 4 }, 1440: { items: 5 } } }); } team_items_5col(); /*------------- [_project_items_5col] ------*/ function project_items_4col() { var owl = $(".project-items-4col"); owl.owlcarousel({ loop: true, margin: 5, autoplay: false, autoplaytimeout: 8000, nav: true, dots: false, navtext: ["", ""], responsive: { 0: { items: 1 }, 425: { items: 1 }, 768: { items: 2 }, 1024: { items: 3 }, 1440: { items: 4 } } }); } project_items_4col(); /*------------- [_new_items_1col] ------*/ function new_items_1col() { var owl = $(".new_items_1col"); owl.owlcarousel({ loop: true, margin: 5, autoplay: true, autoplaytimeout: 8000, nav: false, dots: true, navtext: ["", ""], responsive: { 0: { items: 1 }, 425: { items: 1 }, 768: { items: 1 }, 1024: { items: 1 }, 1440: { items: 1 } } }); } new_items_1col(); /*------------- [_trundle_items_1col] ------*/ function trundle_items_1col() { var owl = $(".trundle_items_1col"); owl.owlcarousel({ loop: true, margin: 5, autoplay: true, autoplaytimeout: 8000, nav: false, dots: true, navtext: ["", ""], responsive: { 0: { items: 1 }, 425: { items: 1 }, 768: { items: 1 }, 1024: { items: 1 }, 1440: { items: 1 } } }); } trundle_items_1col(); /*------------- [_client_items] ------*/ function client_items() { var owl = $(".client-items"); owl.owlcarousel({ loop: true, margin: 30, autoplay: true, autoplaytimeout: 8000, nav: false, dots: false, navtext: ["", ""], responsive: { 0: { items: 1 }, 425: { items: 2 }, 768: { items: 3 }, 1024: { items: 4 }, 1440: { items: 5 } } }); } client_items(); /*------------- [_client_items2] ------*/ function client_items2() { var owl = $(".client-items2"); owl.owlcarousel({ loop: true, margin: 10, autoplay: true, autoplaytimeout: 5000, nav: true, dots: false, navtext: ["", ""], responsive: { 0: { items: 1 }, 425: { items: 2 }, 768: { items: 3 }, 1024: { items: 4 }, 1440: { items: 5 } } }); } client_items2(); /*=============================================*/ /*------------- [_business_items] ------*/ // function business_items() { // var owl = $(".business-items"); // owl.owlcarousel({ // loop: true, // margin: 0, // autoplay: false, // autoplaytimeout: 8000, // nav: true, // dots: false, // navtext: ["", ""], // responsive: { // 0: { // items: 1 // }, // 425: { // items: 2 // }, // 768: { // items: 3 // }, // 1024: { // items: 4 // }, // 1440: { // items: 5 // } // } // }); // } // business_items(); $(".business-items").each(function(index,element){ var owl = $(element); owl.owlcarousel({ loop: false, margin: 0, autoplay: false, autoplaytimeout: 8000, nav: true, dots: false, navtext: ["", ""], responsive: { 0: { items: 1 }, 425: { items: 2 }, 1199: { items: 3 }, 1440: { items: 5 } } }); }) $('.business-tab-nav li').on('click', function() { $(".business-tab-nav li").eq($(this).index()).addclass("active").siblings().removeclass('active'); $(".business-main .business-items").eq($(this).index()).addclass("active").siblings().removeclass('active'); }); $('.business-item-title').on('click', function() { $(this).parents('.business-items').find('.business-item').removeclass('active'); $(this).parent('.business-item').addclass('active'); $('.business-img').fadeout(); var sort = $(this).children('h4').text(); var name = $(this).children('span').text(); var img = $(this).parent('.business-item').find('.business-item-img').attr('src'); var text = $(this).parent('.business-item').find('.business-item-text').html(); $('.business-img').attr('src',img); $('.business-img').fadein(); $('.business-text-left').children('.sort').text(sort); $('.business-text-left').children('.name').text(name); $('.business-text-right').children('div').html(text); }); $('.business-icon').on('click', function() { if($(this).hasclass('active')){ $(this).css('transform','rotate(0deg)'); $(this).removeclass('active'); $(this).parent('.business-content').find('.row').show(); $(this).parent('.business-content').css('padding','30px 40px'); }else{ $(this).css('transform','rotate(180deg)'); $(this).addclass('active'); $(this).parent('.business-content').find('.row').hide(); $(this).parent('.business-content').css('padding','10px'); } }); /*=============================================*/ $("[data-click=scroll-to-target]").on("click", function (d) { d.preventdefault(), d.stoppropagation(); var b = $(this).attr("href"), c = 50; $("html, body").animate({ scrolltop: $(b).offset().top - c }, 500) }), /*------------ [_language_button] -------------*/ /*=============================================*/ $('.language-btn').on('click', function(event) { event.preventdefault(); $(this).next('.language-dropdown').toggleclass('open'); }); /*=============================================*/ /*------------ [_tab_nav] -------------*/ /*=============================================*/ $(".tabs li").on('click',function(){ $(".tabs li").eq($(this).index()).addclass("active").siblings().removeclass('active'); $(".tab-content .tab-item").eq($(this).index()).addclass("active").siblings().removeclass('active'); var text = $(this).text(); $('.nav-address ul li:last-child').text(text); }); /*=============================================*/ /*---------- [_inline_data_attribute] ---------*/ /*=============================================*/ var sectionbgimg = $(".bg-img, .footer, section, div"); sectionbgimg.each(function(indx) { if ($(this).attr("data-background")) { $(this).css("background-image", "url(" + $(this).data("background") + ")"); } }); /*=============================================*/ /*--------------- [_magnificpopup] ------------*/ /*=============================================*/ $('.popup-load').magnificpopup({ type: 'iframe', gallery: { enabled: true } }); $('.img-popup').magnificpopup({ type: 'image', gallery: { enabled: true } }); $('.popup-youtube, .popup-youtube-left, .popup-vimeo, .popup-gmaps').magnificpopup({ type: 'iframe', mainclass: 'mfp-fade', removaldelay: 160, preloader: false, fixedcontentpos: false }); /*=============================================*/ /*------------ [_portfolio_filter] ------------*/ /*=============================================*/ $("#container").imagesloaded(function() { $(".project-filter").on("click", "li", function() { $('li').removeclass("active"); $(this).addclass("active"); var filtervalue = $(this).attr("data-filter"); $grid.isotope({ filter: filtervalue }); }); var $grid = $(".grid").isotope({ itemselector: ".grid-item", percentposition: true, transitionduration: ".6s" }) }); /*=============================================*/ /*--------------- [_counterup] ----------------*/ /*=============================================*/ $('.counter').counterup({ delay: 10, time: 1000 }); /*=============================================*/ /*------------------ [_wow] -------------------*/ /*=============================================*/ if ($('.wow').length) { var wow = new wow({ boxclass: 'wow', animateclass: 'animated', offset: 0, mobile: false, live: true }); wow.init(); } }); // window load event jquery(window).on('load', function() { (function($) { prealoader(); })(jquery); }); }(jquery));