(function ($) { "use strict"; function isIE() { var myNav = navigator.userAgent.toLowerCase(); return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1], 10) : false; } function toggleMobileNavigation() { var navbar = $(".navigation-holder"); var openBtn = $(".navbar-header .open-btn"); var closeBtn = $(".navigation-holder .close-navbar"); openBtn.on("click", function () { if (!navbar.hasClass("slideInn")) { navbar.addClass("slideInn"); } return false; }) closeBtn.on("click", function () { if (navbar.hasClass("slideInn")) { navbar.removeClass("slideInn"); } return false; }) } toggleMobileNavigation(); function toggleClassForSmallNav() { var windowWidth = window.innerWidth; var mainNav = $("#navbar > ul"); if (windowWidth <= 991) { mainNav.addClass("small-nav"); } else { mainNav.removeClass("small-nav"); } } toggleClassForSmallNav(); function smallNavFunctionality() { var windowWidth = window.innerWidth; var mainNav = $(".navigation-holder"); var smallNav = $(".navigation-holder > .small-nav"); var subMenu = smallNav.find(".sub-menu"); var megamenu = smallNav.find(".mega-menu"); var menuItemWidthSubMenu = smallNav.find(".menu-item-has-children > a"); if (windowWidth <= 991) { subMenu.hide(); megamenu.hide(); menuItemWidthSubMenu.on("click", function (e) { var $this = $(this); $this.siblings().slideToggle(); e.preventDefault(); e.stopImmediatePropagation(); }) } else if (windowWidth > 991) { mainNav.find(".sub-menu").show(); mainNav.find(".mega-menu").show(); } } smallNavFunctionality(); function bgParallax() { if ($(".parallax").length) { $(".parallax").each(function () { var height = $(this).position().top; var resize = height - $(window).scrollTop(); var doParallax = -(resize / 5); var positionValue = doParallax + "px"; var img = $(this).data("bg-image"); $(this).css({ backgroundImage: "url(" + img + ")", backgroundPosition: "50%" + positionValue, backgroundSize: "cover" }); }); } } function sliderBgSetting() { if ($(".hero-slider .slide").length) { $(".hero-slider .slide").each(function () { var $this = $(this); var img = ($this.find(".slider-bg").attr("src")) ? $this.find(".slider-bg").attr("src") : false; if (img) { $this.css({ backgroundImage: "url(" + img + ")", backgroundSize: "cover", backgroundPosition: "center center" }) } }); } } //浜烘墠鎷涜仒鏁堟灉 if ($('.joinBanner').length) { $(".md-overlay").hide(); $(".md-trigger").click(function () { $(".md-overlay").show(); }); $(".md-overlay,.md-close").click(function () { $(".md-overlay").hide(); }); } //棣栧浘杞挱 function heroSlider() { if ($(".hero-slider").length) { $(".hero-slider").slick({ arrows: true, dots: true, touchThreshold: 100, autoplay: true, autoplaySpeed: 3500, // cssEase: 'linear', }); } } heroSlider(); //鐐瑰嚮杞挱鍥句笅鏂瑰皬鍦嗙偣鍙互鏀瑰彉杞挱鍥剧墖 $("#myCarousel li").click(function () { var index = $(this).attr("data-slide-to") $('#myCarousel').carousel(parseInt(index)) }) //鍚堜綔浼欎即杞挱 if ($(".partnerCarousel").length) { function partnerCarousel() { $(".partnerCarousel").slick({ arrows: true, dots: true, touchThreshold: 100, autoplay: true, autoplaySpeed: 2500, prevArrow: "", nextArrow: "", }); } partnerCarousel(); } //鏅鸿兘璺熷崟 // if ($(".intelligentDocumentary").length) { // function intelligentDocumentary() { // $(".intelligentDocumentary").slick({ // arrows: true, // dots: true, // touchThreshold: 100, // autoplay: true, // autoplaySpeed: 2500, // slidesPerView : 3, // prevArrow: "", // nextArrow: "", // }); // } // // intelligentDocumentary(); // } let intelligentDocumentary = new Swiper(".intelligentDocumentary", { slidesPerView: 3, spaceBetween: 30, // pagination: { // el: ".swiper-pagination", // clickable: true, // }, }); //浜у搧鍔熻兘杞挱 if ($(".productCarousel").length) { function productCarousel() { $(".productCarousel").slick({ arrows: true, dots: true, touchThreshold: 100, autoplay: true, autoplaySpeed: 3500, prevArrow: "", nextArrow: "", }); } productCarousel(); } //鐢靛晢鍝佺墝瀹㈡埛鍚堜綔 if ($(".brandCarousel").length) { function brandCarousel() { $(".brandCarousel").slick({ dots: true, autoplay: true, touchThreshold: 100, autoplaySpeed: 3500, }); } brandCarousel(); } // 鍙戝睍鍘嗙▼ if ($(".timelineCarousel").length) { let lineSum = $(".timelineCarousel .slide").length; let intDistance = 10; $(".timelineCarousel").css('height', lineSum * 13 + intDistance + 'rem'); // $(".timelineCarousel").css('width', lineSum * 25 + 'rem'); $('.timelineCarousel .slide').each(function (index, item) { $('.timelineCarousel .slide').eq(index).css('bottom', index * 10.5 + 'rem'); }); } // 鑽h獕濂栭」杞挱 if ($(".awardCarousel").length) { function awardCarousel() { $(".awardCarousel").slick({ dots: true, infinite: true, slidesToShow: 5, slidesToScroll: 5, touchThreshold: 100, autoplay: true, autoplaySpeed: 3500, prevArrow: "", nextArrow: "", }); } awardCarousel(); } // 璋冪敤鍦板浘 if ($(".mapBox").length) { // 鐧惧害鍦板浘API鍔熻兘 var map = new BMap.Map("sallmap"); map.centerAndZoom(new BMap.Point(121.423692, 31.223906), 11); // 鍒涘缓鍦板潃瑙f瀽鍣ㄥ疄渚 var myGeo = new BMap.Geocoder(); // 灏嗗湴鍧€瑙f瀽缁撴灉鏄剧ず鍦ㄥ湴鍥句笂锛屽苟璋冩暣鍦板浘瑙嗛噹 myGeo.getPoint("涓婃捣闀垮畞鍖洪暱瀹佽矾1033鍙?9妤?, function (point) { if (point) { map.centerAndZoom(point, 21); map.addOverlay(new BMap.Marker(point)); } }, "涓婃捣甯?); map.enableScrollWheelZoom(true); //寮€鍚紶鏍囨粴杞缉鏀 var map2 = new BMap.Map("hallmap"); map2.centerAndZoom(new BMap.Point(116.404, 39.915), 11); // 鍒涘缓鍦板潃瑙f瀽鍣ㄥ疄渚 var myGeo = new BMap.Geocoder(); // 灏嗗湴鍧€瑙f瀽缁撴灉鏄剧ず鍦ㄥ湴鍥句笂锛屽苟璋冩暣鍦板浘瑙嗛噹 myGeo.getPoint("鏉窞婊ㄦ睙鍖烘花鍏磋矾1912鍙锋煆鐩涙浮鍙eぇ鍘?妤?, function (point) { if (point) { map2.centerAndZoom(point, 21); map2.addOverlay(new BMap.Marker(point)); } }, "鏉窞甯?); map2.enableScrollWheelZoom(true); //寮€鍚紶鏍囨粴杞缉鏀 var map3 = new BMap.Map("hallmap2"); map3.centerAndZoom(new BMap.Point(114.073986,22.660267), 19); // 鍒涘缓鍦板潃瑙f瀽鍣ㄥ疄渚 var myGeo = new BMap.Geocoder(); // 灏嗗湴鍧€瑙f瀽缁撴灉鏄剧ず鍦ㄥ湴鍥句笂锛屽苟璋冩暣鍦板浘瑙嗛噹 myGeo.getPoint("娣卞湷甯傞緳宀楀尯鍧傜敯琛楅亾宀楁邯璺垱淇℃椂浠eぇ鍘?305鍙?, function (point) { if (point) { map3.centerAndZoom(point, 21); map3.addOverlay(new BMap.Marker(point)); } }, "娣卞湷甯?); map3.enableScrollWheelZoom(true); //寮€鍚紶鏍囨粴杞缉鏀 var map4 = new BMap.Map("hallmap3"); map4.centerAndZoom(new BMap.Point(113.329775,23.154618), 11); // 鍒涘缓鍦板潃瑙f瀽鍣ㄥ疄渚 var myGeo = new BMap.Geocoder(); // 灏嗗湴鍧€瑙f瀽缁撴灉鏄剧ず鍦ㄥ湴鍥句笂锛屽苟璋冩暣鍦板浘瑙嗛噹 myGeo.getPoint("骞夸笢鐪佸箍宸炲競澶╂渤鍖轰繚鍒╀腑姹囧箍鍦篈搴?702-1703", function (point) { if (point) { map4.centerAndZoom(point, 21); map4.addOverlay(new BMap.Marker(point)); } }, "骞垮窞甯?); map4.enableScrollWheelZoom(true); //寮€鍚紶鏍囨粴杞缉鏀 // // var map5 = new BMap.Map("hallmap4"); // map5.centerAndZoom(new BMap.Point(114.282762,30.594615), 11); // // 鍒涘缓鍦板潃瑙f瀽鍣ㄥ疄渚 // var myGeo = new BMap.Geocoder(); // // 灏嗗湴鍧€瑙f瀽缁撴灉鏄剧ず鍦ㄥ湴鍥句笂锛屽苟璋冩暣鍦板浘瑙嗛噹 // myGeo.getPoint("婀栧寳鐪佹姹夊競姹熸眽鍖烘柊鍗庤矾186鍙风鏄熷煄甯傝姳鍥?鏍?5灞?5-4鎴?, function (point) { // if (point) { // map5.centerAndZoom(point, 21); // map5.addOverlay(new BMap.Marker(point)); // } // }, // "姝︽眽甯?); // map5.enableScrollWheelZoom(true); //寮€鍚紶鏍囨粴杞缉鏀 } // if ($(".knowFunction").length) { // function menuTabClick(flag) { // $(".columnList li").eq(flag).addClass("active").siblings().removeClass("active"); // } // function getHash(urlHash) { // switch (urlHash) { // case '': // menuTabClick(0) // break; // case 'smartMarketing': // menuTabClick(1) // break; // case 'smartRecommend': // menuTabClick(2) // break; // case 'qualityTesting': // menuTabClick(3) // break; // case 'cloudGuard': // menuTabClick(4) // break; // default: ; // } // } // $(".menuTab li").click(function () { // // $(".columnList li").eq($(this).index()).addClass("active").siblings().removeClass("active"); // var urlHash = $(this).find('a').attr('href').split('#')[1]; // getHash(urlHash); // }) // var hash = window.location.hash.split('#')[1]; // getHash(hash); // $(".columnList li").click(function () { // $(".columnList li").eq($(this).index()).addClass("active").siblings().removeClass("active"); // }) // } // 瑙嗛鎾斁 if ($("#video").length) { jsModern.video("#video"); //鎾斁瑙嗛 $(".VideoBtn").click(function () { var video = document.getElementById("videoShow"); video.play(); $('.VideoBtn').hide(); }) //鐩戝惉瑙嗛鐨勬挱鏀剧姸鎬 var video = document.getElementById("videoShow"); video.oncanplay = function () { $(".VideoBtn").show(); //$("#video").attr("poster",""); } //瑙嗛鎾斁浜嬩欢 video.onplay = function () { $("#videoShow").attr("poster", ""); $(".VideoBtn").hide(); }; video.onplaying = function () { $(".VideoBtn").hide(); }; //瑙嗛鏆傚仠浜嬩欢 video.onpause = function () { $(".VideoBtn").show(); }; //鐐瑰嚮瑙嗛鍛ㄥ洿鏆傚仠鎾斁鍥剧墖鍑虹幇 video.onclick = function () { if (video.paused) { $(".VideoBtn").hide(); video.play(); } else { $(".VideoBtn").show(); video.pause(); } }; } function preloader() { if ($('.preloader').length) { // $('.preloader').delay(100).fadeOut(500, function () { //active wow wow.init(); $('.preloader').hide(); // }); } } if ($('.recent-Blog-thumbs').length) { $('.recent-blog-thumb').on('click', function (e) { e.preventDefault(); var target = $($(this).attr('data-case')); $('.recent-blog-thumb').removeClass('active-thumb'); $(this).addClass('active-thumb'); $('.recent-Blog-content .recent-blog-data').hide(0); $('.recent-blog-data').fadeOut(300).removeClass('active-blog-data'); $(target).fadeIn(300).addClass('active-blog-data'); }); } var wow = new WOW({ boxClass: 'wow', // default animateClass: 'animated', // default offset: 0, // default mobile: true, // default live: true // default }); if ($(".fancybox").length) { $(".fancybox").fancybox({ openEffect: "elastic", closeEffect: "elastic", wrapCSS: "project-fancybox-title-style" }); } if ($(".video-btn").length) { $(".video-btn").on("click", function () { $.fancybox({ href: this.href, type: $(this).data("type"), 'title': this.title, helpers: { title: { type: 'inside' }, media: {} }, beforeShow: function () { $(".fancybox-wrap").addClass("gallery-fancybox"); } }); return false }); } function cloneNavForSticyMenu($ele, $newElmClass) { $ele.addClass('original').clone().insertAfter($ele).addClass($newElmClass).removeClass('original'); } if ($('.site-header .navigation').length) { cloneNavForSticyMenu($('.site-header .navigation'), "sticky-header"); } var lastScrollTop = ''; function stickyMenu($targetMenu, $toggleClass) { var st = $(window).scrollTop(); var mainMenuTop = $('.site-header .navigation'); if ($(window).scrollTop() > 150) { if (mainMenuTop > lastScrollTop) { // hide sticky menu on scroll down $targetMenu.removeClass($toggleClass); } else { // active sticky menu on scroll up $targetMenu.addClass($toggleClass); } } else { $targetMenu.removeClass($toggleClass); } lastScrollTop = st; } function toggleSideInfo() { if ($(".side-info").length) { var sindeInfo = $(".side-info .side-info-wrapper"); var sideInfoOpenBtn = $(".info-bars"); var sideInfoCloseBtn = $(".side-info-close-btn"); $(document.body).append(sindeInfo); sideInfoOpenBtn.on("click", function (e) { sindeInfo.find(".side-info-inner").toggleClass("toggle-side-info"); sindeInfo.toggleClass("side-info-wrapper-toggle"); return false; }) sideInfoCloseBtn.on("click", function (e) { sindeInfo.find(".side-info-inner").toggleClass("toggle-side-info"); sindeInfo.toggleClass("side-info-wrapper-toggle"); return false; }) } } function sortingGallery() { if ($(".sortable-gallery .gallery-filters").length) { var $container = $('.gallery-container'); $container.isotope({ filter: '*', animationOptions: { duration: 750, easing: 'linear', queue: false, } }); $(".gallery-filters li a").on("click", function () { $('.gallery-filters li .current').removeClass('current'); $(this).addClass('current'); var selector = $(this).attr('data-filter'); $container.isotope({ filter: selector, animationOptions: { duration: 750, easing: 'linear', queue: false, } }); return false; }); } } sortingGallery(); function masonryGridSetting() { if ($('.masonry-gallery').length) { var $grid = $('.masonry-gallery').masonry({ itemSelector: '.grid-item', columnWidth: '.grid-item', percentPosition: true }); $grid.imagesLoaded().progress(function () { $grid.masonry('layout'); }); } } if ($(".header-search-form-wrapper").length) { var searchToggleBtn = $(".search-toggle-btn"); var searchContent = $(".header-search-form"); var body = $("body"); searchToggleBtn.on("click", function (e) { searchContent.toggleClass("header-search-content-toggle"); e.stopPropagation(); }); body.on("click", function () { searchContent.removeClass("header-search-content-toggle"); }).find(searchContent).on("click", function (e) { e.stopPropagation(); }); } function testimonial_carousel() { var owl = $(".testimonial-active"); owl.owlCarousel({ loop: true, margin: 30, nav: false, items: 1, smartSpeed: 1500, dots: true, vertical: true, // autoplay: true, autoplayTimeout: 2000, }); } testimonial_carousel(); preloader(); $(window).on('load', function () { sliderBgSetting(); toggleMobileNavigation(); smallNavFunctionality(); toggleSideInfo(); }); $(window).on("scroll", function () { if ($(".site-header").length) { stickyMenu($('.site-header .navigation'), "sticky-on"); } }); $(window).on("resize", function () { toggleClassForSmallNav(); clearTimeout($.data(this, 'resizeTimer')); $.data(this, 'resizeTimer', setTimeout(function () { smallNavFunctionality(); }, 200)); }); if ($(".odometer").length) { $('.odometer').appear(); $(document.body).on('appear', '.odometer', function (e) { var odo = $(".odometer"); odo.each(function () { var countNumber = $(this).attr("data-count"); $(this).html(countNumber); }); }); } if ($(".sideBarBox").length) { if ($(".sideBarItem").css("opacity") == 1) { $('.sideBarItem').css("pointer-events", 'auto') } else { $('.sideBarItem').css("pointer-events", 'none') } $(".sideBarBtn").on("click", function () { if ($(".sideBarItem").css("opacity") == 1) { $('.sideBarItem').css("pointer-events", 'none') $('.sideBarItem').css("opacity", '0'); $('.sideBarBtn').html('灞曞紑') } else { $('.sideBarItem').css("pointer-events", 'auto') $('.sideBarItem').css("opacity", '1'); $('.sideBarBtn').html('鏀剁缉') } }) } })(window.jQuery); jQuery(document).ready(function ($) { $('.joinBtn').click(function () { $('.theme-popover-mask').fadeIn(100); $('.joinIn').slideDown(200); }) $('.theme-poptit .joinClose').click(function () { $('.theme-popover-mask').fadeOut(100); $('.joinIn').slideUp(200); }) }) jQuery(document).ready(function ($) { $('.contactBtn').click(function () { $('.theme-popover-mask').fadeIn(100); $('.contactBox').slideDown(200); }) $('.theme-poptit .close').click(function () { $('.theme-popover-mask').fadeOut(100); $('.contactBox').slideUp(200); }) }) // $(function(){ // if($(".contactBox").length){ // setTimeout(function(){ // $('.theme-popover-mask').fadeIn(100); // $('.contactBox').slideDown(200); // },10000) // } // }) // 鍔犵洘鍒嗙珯鍩庡競 if ($('.cityList li').length) { // 鍒濆鍖栬皟鐢ㄥ嚱鏁 let Dom; function getMapInfo() { Dom = $(".cityList li.active") let zuobiao = Dom.attr("data-zuobiao"); var name = Dom.attr("data-companyName"); var addrsee = Dom.attr("data-addrsee"); var phone = Dom.attr("data-phone"); console.log(zuobiao, name, addrsee, phone) ShowMap(zuobiao, name, addrsee, phone); } getMapInfo(); console.log($('.companyCont').length) $('.companyCont:eq(0)').show(); $('.cityList li').click(function () { $('.cityList li').removeClass('active'); $(this).addClass('active') var index = $('.cityList .active').index(); $('.companyCont').hide() $('.companyCont:eq(' + index + ')').show(); getMapInfo(); }) function ShowMap(zuobiao, name, addrsee, phone) { var arrzuobiao = zuobiao.split(','); var map = new BMap.Map("allmap"); map.addControl(new BMap.OverviewMapControl()); map.centerAndZoom(new BMap.Point(arrzuobiao[0], arrzuobiao[1]), 20); map.addControl(new BMap.NavigationControl()); var marker = new BMap.Marker(new BMap.Point(arrzuobiao[0], arrzuobiao[1])); map.addOverlay(marker); var infoWindow = new BMap.InfoWindow('

' + name + '

鍦板潃锛? + addrsee + '

鐑嚎锛? + phone + '

'); marker.addEventListener("click", function () { this.openInfoWindow(infoWindow); }); marker.openInfoWindow(infoWindow); } } var s = { sliderIndex: 0, sliderWait: 0, sliderOn: !1, init: function () { $(".product-features-tab").hover(function () { s.sliderOn = !0; var e = $(".product-features-tab").index($(this)); s.sliderIndex = e, s.sliderRun(e) }, function () { s.sliderOn = !1 }), $(".product-features-content").hover(function () { s.sliderOn = !0 }, function () { s.sliderOn = !1 }), setInterval(s.sliderAuto, 1500) }, sliderAuto: function () { s.sliderOn ? s.sliderWait = 0 : (s.sliderWait += 1, 5 <= s.sliderWait && (s.sliderIndex += 1, $(".product-features-tab").eq(s.sliderIndex).trigger("mouseenter").trigger("mouseleave"), s.sliderWait = 0)) }, sliderRun: function (e) { s.sliderIndex = e || s.sliderIndex, s.sliderIndex == $(".product-features-tab").length && (s.sliderIndex = 0), s.sliderIndex < 0 && (s.sliderIndex = $(".product-features-tab").length - 1), console.log("sliderRun", s.sliderIndex), $(".product-features-tab").eq(s.sliderIndex).addClass("on").siblings().removeClass("on"), $(".product-features-content").removeClass("on").eq(s.sliderIndex).addClass("on") } }; s.init()