(function($) { "use strict"; function handlepreloader() { if($('.preloader').length){ $('.preloader').delay(200).fadeout(500); } } //update header style and scroll to top function headerstyle() { if($('.main-header').length){ var windowpos = $(window).scrolltop(); var siteheader = $('.main-header'); var scrolllink = $('.scroll-to-top'); var sticky_header = $('.main-header .sticky-header'); if (windowpos > 100) { siteheader.addclass('fixed-header'); sticky_header.addclass("animated slideindown"); scrolllink.fadein(300); } else { siteheader.removeclass('fixed-header'); sticky_header.removeclass("animated slideindown"); scrolllink.fadeout(300); } } } headerstyle(); $(".slidnub li:first").addclass("active"); $(".bannerslid .carousel-item:first").addclass("active"); //submenu dropdown toggle if($('.main-header li.dropdown ul').length){ $('.main-header .navigation li.dropdown').append(''); } //mobile nav hide show if($('.mobile-menu').length){ var mobilemenucontent = $('.main-header .nav-outer .main-menu .navigation').html(); $('.mobile-menu').append('
'); $('.mobile-menu .navigation').append(mobilemenucontent); $('.sticky-header .navigation').append(mobilemenucontent); $('.mobile-menu .close-btn').on('click', function() { $('body').removeclass('mobile-menu-visible'); }); //dropdown button $('.mobile-menu li.dropdown .dropdown-btn').on('click', function() { $(this).prev('ul').slidetoggle(500); }); //menu toggle btn $('.mobile-nav-toggler').on('click', function() { $('body').addclass('mobile-menu-visible'); }); //menu toggle btn $('.mobile-menu .menu-backdrop,.mobile-menu .close-btn').on('click', function() { $('body').removeclass('mobile-menu-visible'); }); } //team block if($('.team-block').length){ $('.team-block .info-btn').on('click', function() { $(this).toggleclass('active'); $(this).parents('.inner-box').toggleclass('active'); $(this).parents('.team-block').siblings().find('.inner-box, .info-btn').removeclass('active'); }); } //news block if($('.news-block-three .social-toggle-btn').length){ $('.news-block-three .social-toggle-btn').on('click', function() { $(this).parents('.social-links').toggleclass('active'); }); } // single item carousel if ($('.single-item-carousel').length) { $('.single-item-carousel').owlcarousel({ loop:true, margin:30, nav:true, singleitem:true, smartspeed: 700, autoheight: false, autoplay: true, autoplaytimeout:10000, navtext: [ '', '' ], responsive:{ 0:{ items:1 }, 600:{ items:1 }, 1024:{ items:1 }, } }); } // testimonials carousel if ($('.testimonial-carousel').length) { $('.testimonial-carousel').owlcarousel({ loop:true, margin:30, nav:true, smartspeed: 500, autoplay: true, navtext: [ '', '' ], responsive:{ 0:{ items:1 }, 764:{ items:1 }, 1024:{ items:2 } } }); } // testimonials carousel two if ($('.testimonial-carousel-two').length) { $('.testimonial-carousel-two').owlcarousel({ loop:true, margin:30, nav:true, smartspeed: 500, autoplay: true, navtext: [ '', '' ], responsive:{ 0:{ items:1 }, 768:{ items:1 }, 1024:{ items:1 } } }); } // services carousel if ($('.services-carousel-two').length) { $('.services-carousel-two').owlcarousel({ loop:true, margin:30, nav:true, smartspeed: 500, autoplay: true, navtext: [ '', '' ], responsive:{ 0:{ items:1 }, 768:{ items:2 }, 1024:{ items:4 } } }); } // testimonials carousel three if ($('.testimonial-carousel-three').length) { $('.testimonial-carousel-three').owlcarousel({ loop:true, margin:30, nav:true, smartspeed: 500, autoplay: true, navtext: [ 'keyboard_arrow_left', 'keyboard_arrow_right' ], responsive:{ 0:{ items:1 }, 764:{ items:1 }, 1024:{ items:1 } } }); } // team carousel if ($('.team-carousel').length) { $('.team-carousel').owlcarousel({ loop:true, margin:30, nav:true, smartspeed: 500, autoplay: true, navtext: [ '', '' ], responsive:{ 0:{ items:1 }, 600:{ items:2 }, 768:{ items:3 }, 1024:{ items:4 } } }); } // sponsors carousel if ($('.sponsors-carousel').length) { $('.sponsors-carousel').owlcarousel({ loop:true, margin:30, nav:false, smartspeed: 500, autoplay: true, navtext: [ '', '' ], responsive:{ 0:{ items:1 }, 600:{ items:2 }, 768:{ items:3 }, 1024:{ items:4 }, 1280:{ items:5 } } }); } // services carousel if ($('.services-carousel').length) { $('.services-carousel').owlcarousel({ loop:true, margin:30, nav:true, smartspeed: 500, autoplay: true, navtext: [ '', '' ], responsive:{ 0:{ items:1 }, 768:{ items:1 }, 1024:{ items:2 } } }); } // projects carousel if ($('.projects-carousel').length) { $('.projects-carousel').owlcarousel({ loop:true, margin:30, nav:true, smartspeed: 500, autoplay: true, navtext: [ '', '' ], responsive:{ 0:{ items:1 }, 600:{ items:2 }, 768:{ items:3 }, 1024:{ items:4 } } }); } //progress bar if($('.progress-line').length){ $('.progress-line').appear(function(){ var el = $(this); var percent = el.data('width'); $(el).css('width',percent+'%'); },{accy: 0}); } //jquery knob animation if($('.dial').length){ $('.dial').appear(function(){ var elm = $(this); var color = elm.attr('data-fgcolor'); var perc = elm.attr('value'); elm.knob({ 'value': 0, 'min':0, 'max':100, 'skin':'tron', 'readonly':true, 'thickness':0.06, 'dynamicdraw': true, 'displayinput':false }); $({value: 0}).animate({ value: perc }, { duration: 3000, easing: 'swing', progress: function () { elm.val(math.ceil(this.value)).trigger('change'); } }); //circular progress bar color $(this).append(function() { // elm.parent().parent().find('.circular-bar-content').css('color',color); //elm.parent().parent().find('.circular-bar-content .txt').text(perc); }); },{accy: 20}); } //fact counter + text count 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}); } //sortable masonary with filters function enablemasonry() { if($('.sortable-masonry').length){ var window = $(window); // needed variables var $container=$('.sortable-masonry .items-container'); var $filter=$('.filter-btns'); $container.isotope({ filter:'*', masonry: { columnwidth : '.masonry-item.col-lg-4' }, animationoptions:{ duration:500, easing:'linear' } }); // isotope filter $filter.find('li').on('click', function(){ var selector = $(this).attr('data-filter'); try { $container.isotope({ filter : selector, animationoptions: { duration: 500, easing : 'linear', queue : false } }); } catch(err) { } return false; }); window.on('resize', function(){ var selector = $filter.find('li.active').attr('data-filter'); $container.isotope({ filter : selector, animationoptions: { duration: 500, easing : 'linear', queue : false } }); }); var filteritema = $('.filter-btns li'); filteritema.on('click', function(){ var $this = $(this); if ( !$this.hasclass('active')) { filteritema.removeclass('active'); $this.addclass('active'); } }); } } enablemasonry(); //gallery filters if($('.filter-list').length){ $('.filter-list').mixitup({}); } //custom seclect box if($('.custom-select-box').length){ $('.custom-select-box').selectmenu().selectmenu('menuwidget').addclass('overflow'); } //lightbox / fancybox if($('.lightbox-image').length) { $('.lightbox-image').fancybox({ openeffect : 'fade', closeeffect : 'fade', helpers : { media : {} } }); } //tabs box if($('.tabs-box').length){ $('.tabs-box .tab-buttons .tab-btn').on('click', function(e) { e.preventdefault(); var target = $($(this).attr('data-tab')); if ($(target).is(':visible')){ return false; }else{ target.parents('.tabs-box').find('.tab-buttons').find('.tab-btn').removeclass('active-btn'); $(this).addclass('active-btn'); target.parents('.tabs-box').find('.tabs-content').find('.tab').fadeout(0); target.parents('.tabs-box').find('.tabs-content').find('.tab').removeclass('active-tab animated fadein'); $(target).fadein(0); $(target).addclass('active-tab animated fadein'); } }); } $(".list_dt").on("click",function () { $('.list_dd').stop(); $(this).siblings("dt").removeattr("id"); if($(this).attr("id")=="open"){ $(this).removeattr("id").siblings("dd").slideup(); }else{ $(this).attr("id","open").next().slidedown().siblings("dd").slideup(); } }); //accordion box if($('.accordion-box').length){ $(".accordion-box").on('click', '.acc-btn', function() { var outerbox = $(this).parents('.accordion-box'); var target = $(this).parents('.accordion'); if($(this).hasclass('active')!==true){ $(outerbox).find('.accordion .acc-btn').removeclass('active'); } if ($(this).next('.acc-content').is(':visible')){ return false; }else{ $(this).addclass('active'); $(outerbox).children('.accordion').removeclass('active-block'); $(outerbox).find('.accordion').children('.acc-content').slideup(300); target.addclass('active-block'); $(this).next('.acc-content').slidedown(300); } }); } //contact form validation if($('#contact-form').length){ $('#contact-form').validate({ rules: { username: { required: true }, email: { required: true, email: true }, phone: { required: true }, message: { required: true } } }); } // scroll to a specific div if($('.scroll-to-target').length){ $(".scroll-to-target").on('click', function() { var target = $(this).attr('data-target'); // animate $('html, body').animate({ scrolltop: $(target).offset().top }, 1500); }); } // elements animation if($('.wow').length){ var wow = new wow( { boxclass: 'wow', // animated element css class (default is wow) animateclass: 'animated', // animation css class (default is animated) offset: 0, // distance to the element when triggering the animation (default is 0) mobile: false, // trigger animations on mobile devices (default is true) live: true // act on asynchronously loaded content (default is true) } ); wow.init(); } //??????? ????????�????�?????????,????????????? $(".shangqiao").click(function(event) { if ($('#nb_invite_ok').length > 0) { $('#nb_invite_ok').click(); } }); /* ========================================================================== when document is scrollig, do ========================================================================== */ $(window).on('scroll', function() { headerstyle(); }); /* ========================================================================== when document is loading, do ������ȫ��õ�bootstrapģ�壺http://www.bootstrapmb.com ========================================================================== */ $(window).on('load', function() { handlepreloader(); enablemasonry(); }); })(window.jquery);