(function($) { "use strict"; //最新最全最好的Bootstrap模板:http://www.bootstrapmb.com //Hide Loading Box (Preloader) function handlePreloader() { if ($('.preloader').length) { $('.preloader').delay(200).fadeOut(500); } } //Update Header Style and Scroll to Top function headerStyle() { if ($('.corpo-header').length) { var windowpos = $(window).scrollTop(); var siteHeader = $('.corpo-header'); var scrollLink = $('.scroll-top'); if (windowpos >= 100) { siteHeader.addClass('fixed-header'); scrollLink.fadeIn(300); } else { siteHeader.removeClass('fixed-header'); scrollLink.fadeOut(300); } } } headerStyle(); //Submenu Dropdown Toggle if ($('.corpo-header li.dropdown ul').length) { $('.corpo-header li.dropdown').append(''); //Dropdown Button $('.corpo-header li.dropdown .dropdown-btn').on('click', function() { $(this).prev('ul').slideToggle(500); }); //Disable dropdown parent link $('.corpo-header .navigation li.dropdown > a,.hidden-bar .side-menu li.dropdown > a').on('click', function(e) { e.preventDefault(); }); } //Progress Bar if ($('.progress-line').length) { $('.progress-line').appear(function() { var el = $(this); var percent = el.data('width'); $(el).css('width', percent + '%'); }, { accY: 0 }); } //Make Content Sticky if ($('.sticky-box').length) { var a = new StickySidebar('.sidebar-page-container .sidebar-side .sidebar .inner', { topSpacing: 80, bottomSpacing: 0, containerSelector: '.sticky-container', innerWrapperSelector: '.sticky-box' }); } //Custom Seclect Box if ($('.custom-select-box').length) { $('.custom-select-box').selectmenu().selectmenu('menuWidget').addClass('overflow'); } //Gallery Filters //if ($('.filter-list').length) { // $('.filter-list').mixItUp({}); //} //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 }); } ////Main Slider Carousel //if ($('.slider-carousel').length) { // $('.slider-carousel').owlCarousel({ // animateOut: 'fadeOut', // animateIn: 'fadeIn', // loop: true, // margin: 0, // nav: true, // autoHeight: true, // smartSpeed: 500, // autoplay: 6000, // //stopOnHover: true, // //autoplay: true, // //autoplaySpeed: 10000, // //autoplayHoverPause: true, // navText: ['', ''], // responsive: { // 0: { // items: 1 // }, // 600: { // items: 1 // }, // 800: { // items: 1 // }, // 1024: { // items: 1 // }, // 1200: { // items: 1 // } // } // }); //} // Single Item Carousel if ($('.single-item-carousel').length) { $('.single-item-carousel').owlCarousel({ loop: true, margin: 0, nav: true, smartSpeed: 500, autoplay: 5000, navText: ['', ''], responsive: { 0: { items: 1 }, 600: { items: 1 }, 800: { items: 1 }, 1024: { items: 1 }, 1200: { items: 1 } } }); } // Two Item Carousel if ($('.two-item-carousel').length) { $('.two-item-carousel').owlCarousel({ loop: true, margin: 30, nav: true, autoHeight: true, smartSpeed: 500, autoplay: 5000, navText: ['', ''], responsive: { 0: { items: 1 }, 600: { items: 2 }, 800: { items: 2 }, 1024: { items: 2 }, 1200: { items: 2 } } }); } // Four Item Carousel //if ($('.four-item-carousel').length) { // $('.four-item-carousel').owlCarousel({ // loop: true, // margin: 15, // nav: true, // autoHeight: true, // smartSpeed: 500, // //autoplay: 5000, // navText: ['', ''], // responsive: { // 0: { // items: 1 // }, // 600: { // items: 2 // }, // 800: { // items: 3 // }, // 1024: { // items: 3 // }, // 1200: { // items: 4 // } // } // }); //} //Three Item Carousel if ($('.three-item-carousel').length) { $('.three-item-carousel').owlCarousel({ loop: true, margin: 30, nav: true, smartSpeed: 500, autoplay: 5000, navText: ['', ''], responsive: { 0: { items: 1 }, 600: { items: 1 }, 800: { items: 2 }, 1024: { items: 2 }, 1200: { items: 3 } } }); } //Experts Carousel if ($('.experts-carousel').length) { $('.experts-carousel').owlCarousel({ loop: true, margin: 30, nav: true, smartSpeed: 500, autoplay: 5000, navText: ['', ''], responsive: { 0: { items: 1 }, 600: { items: 1 }, 800: { items: 2 }, 1024: { items: 2 }, 1200: { items: 3 } } }); } //LightBox / Fancybox if ($('.lightbox-image').length) { $('.lightbox-image').fancybox({ openEffect: 'fade', closeEffect: 'fade', helpers: { media: {} } }); } // Scroll to a Specific Div if ($('.scroll-target').length) { $(".scroll-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: true, // trigger animations on mobile devices (default is true) live: true // act on asynchronously loaded content (default is true) }); wow.init(); } /* ========================================================================== 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(); }); $(".footer div .icon").hover(function () { if ($(this).hasClass("cur")) { $(this).removeClass("cur"); $(this).find(".pos").slideUp(); } else { $(this).addClass("cur"); $(this).find(".pos").slideDown(); } }); //搜索框 $(".fa-search").on('click', function () { $(".search-form").removeClass("none"); $('.main-menu1').addClass("none"); $('.search-menu').addClass("none"); }); $(".clear").on('click', function () { // 关闭搜索框 $('.search-form').addClass("none"); $(".main-menu1").removeClass("none"); $(".search-menu").removeClass("none"); }); // 点击除搜索框以外的其他部分时关闭搜索框 $(document).on('click', function (e) { if ($(e.target).closest('.form-container').length > 0) { } else { if (!$('.search-form').hasClass("none")) { // 关闭搜索框 $('.search-form').addClass("none"); $(".main-menu1").removeClass("none"); $(".search-menu").removeClass("none"); } } }) })(window.jQuery); var block = false;