jQuery(document).ready(function() { //楠岃瘉閭 // let regEmail = new RegExp("^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$"); //浜岀骇瀵艰埅鍏ㄥ睆 let qcloud = {}; $('[_t_nav]').hover(function() { let _nav = $(this).attr('_t_nav'); clearTimeout(qcloud[_nav + '_timer']); qcloud[_nav + '_timer'] = setTimeout(function() { $('[_t_nav]').each(function() { $(this)[_nav == $(this).attr('_t_nav') ? 'addClass' : 'removeClass']('active'); }); $('#' + _nav).stop(true, true).show(); }, 150); }, function() { let _nav = $(this).attr('_t_nav'); clearTimeout(qcloud[_nav + '_timer']); qcloud[_nav + '_timer'] = setTimeout(function() { $('#' + _nav).stop(true, true).hide(); }, 300); $('[_t_nav]').removeClass('active'); }); // Carousel new Swiper("#myCarousel", { autoplay: { delay: 5000, }, loop: true, effect: "fade", fadeEffect: { crossFade: true, }, pagination: { el: ".index-indicators", clickable: true, }, }); new Swiper("#myCarouselMobile", { autoplay: { delay: 5000, }, loop: true, effect: "fade", fadeEffect: { crossFade: true, }, pagination: { el: ".index-indicators", clickable: true, }, }); new Swiper("#newsRecommend", { autoplay: { delay: 10000, }, loop: true, effect: "fade", fadeEffect: { crossFade: true, }, pagination: { el: ".news-recommend-indicators", clickable: true, }, }); // collapse $('.navAll li .each-event').on('click', function(e) { if (!$(this).siblings('.navTwo').hasClass('in')) { $('.navAll li i').removeClass('glyphicon-minus').addClass('glyphicon-plus'); $(this).find('i').removeClass('glyphicon-plus').addClass('glyphicon-minus'); } else { $(this).find('i').removeClass('glyphicon-minus').addClass('glyphicon-plus'); } }); // hover div 鏁堟灉 $('.more-sup,.more-service').hover(function(e) { $(this).addClass('hover-active'); $(this).find('h3').css('color', '#fff'); $(this).find('p').removeClass('display-none'); $(this).find('span').css('color', '#999999').removeClass('display-ellipsis'); $(this).find('.hover-test').css('display', 'none'); }, function(e) { $(this).removeClass('hover-active'); $(this).find('h3').css('color', '#333333').removeClass('hover-h3'); $(this).find('p').addClass('display-none'); $(this).find('span').css('color', '#666666').addClass('display-ellipsis'); $(this).find('.hover-test').css('display', 'block'); }); // 棣栭〉铏氭嫙鍖栧钩鍙伴紶鏍囩Щ涓婂幓鏁堟灉 $('.hypervisor-content .hypervisor-p').mouseover(function() { $(this).find('span').removeClass('display-none'); }).mouseout(function() { $(this).find('span').addClass('display-none'); }); // 澶氱鍦烘櫙 let scenarioSwiper = new Swiper(".scenario-swiper", { autoplay: false, loop: true, pagination: { el: ".scenario-swiper .swiper-pagination", clickable: true, } }) scenarioSwiper.on('slideChangeTransitionStart', function() { console.log(this.realIndex) changeScenario(this.realIndex) }) let scenarioLi = $("ul.scenario-nav li"); scenarioLi.mouseover(function() { let index = $(this).index(); scenarioSwiper.slideTo(index + 1, 250, false); changeScenario(index) }) function changeScenario(index) { let $this = scenarioLi.eq(index); $this.addClass("active"); $this.find("img").attr("src", "res/img/homepage/scenario/0" + (index + 1) + "-active.png"); $this.siblings("li").each(function(i, e) { let $e = $(e); $e.removeClass("active"); $e.find("img").attr("src", "res/img/homepage/scenario/0" + ($(this).index() + 1) + "-button.png"); }) } // 瀹㈡埛妗堜緥 new Swiper(".brand-container", { autoplay:false, // autoplay: { // delay: 2500, // }, loop: true, pagination: { el: ".brand-container .swiper-pagination", clickable: true, }, }); //澶囦唤榧犳爣绉讳笂鍘绘晥鏋 /*$('.backup-func').mouseover(function() { if ($(this).hasClass('swiper-slide-active') || $(this).hasClass('swiper-slide-prev') || $(this).hasClass('swiper-slide-next')) { $(this).addClass('swiper-div-hover'); $(this).find('h3').addClass('swiper-h3-hover'); $(this).find('p').addClass('swiper-p-hover'); $(this).find('button').addClass('swiper-button-hover'); } }).mouseout(function() { $(this).removeClass('swiper-div-hover'); $(this).find('h3').removeClass('swiper-h3-hover'); $(this).find('p').removeClass('swiper-p-hover'); $(this).find('button').removeClass('swiper-button-hover'); });*/ // $('.backup-module').mouseover(function(){ // $(this).find('.title-underline').css('width', '0 !important'); // $(this).find('.backup-underline').addClass('backup-mode-hover'); // }).mouseout(function(){ // $(this).find('.backup-underline').removeClass('backup-mode-hover'); // }); // 棣栭〉鎭㈠妯″潡榧犳爣绉讳笂鍘绘晥鏋 $(".recovery-module .item").mouseover(function() { $(".recovery-module .item").eq(1).removeClass("active"); $(this).addClass("active"); }).mouseout(function() { $(this).removeClass("active"); $(".recovery-module .item").eq(1).addClass("active"); }); // 棣栭〉琛屼笟妯″潡榧犳爣绉讳笂鍘绘晥鏋 /*$('.industry-solution').mouseover(function() { $(this).find('.solution-title p').addClass('solution-p-hover'); $(this).find('h3').addClass('solution-h3-hover'); $(this).find('.bottom-content ').removeClass('display-none'); $(this).find('.solution-content a').addClass('solution-a-hover'); let parent = $(this); $(this).find('a').mouseover(function() { $(parent).find('.industry-circle1').removeClass('display-none'); $(parent).find('.industry-circle2').removeClass('display-none'); }).mouseout(function() { $(parent).find('.industry-circle1').addClass('display-none'); $(parent).find('.industry-circle2').addClass('display-none'); }); }).mouseout(function() { $(this).find('.solution-title p').removeClass('solution-p-hover'); $(this).find('h3').removeClass('solution-h3-hover'); $(this).find('.bottom-content ').addClass('display-none'); $(this).find('.solution-content a').removeClass('solution-a-hover'); $(this).find('.industry-circle1').addClass('display-none'); $(this).find('.industry-circle2').addClass('display-none'); });*/ // 鍓湰妯″潡 $('.copy-module .hvr-shutter-in-vertical').mouseover(function() { $('.hvr-shutter-in-vertical').text('鐐瑰嚮璇︽儏'); }).mouseout(function() { $('.hvr-shutter-in-vertical').text('浜嗚В鏇村'); }); $(".hypervisor-module .brands .thumb").click(function() { let index = $(this).data("index"); let url = $("#"+index+" .more").attr("href"); window.open(url); }) $(".hypervisor-module .brands .thumb").mouseover(function() { let $before = $(".hypervisor-module .brands .thumb.active"); $before.removeClass("active"); $before.find("img").attr("src", "res/img/homepage/brand/" + $before.data("index") + ".png"); let index = $(this).data("index"); $(".hypervisor-module .support").addClass("hidden"); $(".hypervisor-module").find("#" + index).removeClass("hidden"); $(this).addClass("active"); $(this).find("img").attr("src", "res/img/homepage/brand/" + index + "-hover.png") }) // 鏂伴椈鏁版嵁 $(document).on("mouseenter", ".news-module .item", function() { $(".news-module .item").eq(1).removeClass("active") $(this).addClass("active"); }).on('mouseleave', '.news-module .item', function() { $(this).removeClass("active") $(".news-module .item").eq(1).addClass("active") }) let news_data = {}, isAjax = false; $("#index-news-load").click(function() { if (isAjax) { return } let $i = $(this).find("i"); if (news_data.page === undefined) { news_data.page = 1; } news_data.page++; isAjax = true $.get('./tpl/index-news.php', news_data, function(response) { if (isAjax) { isAjax = false } if (response === "") { if (news_data.page === 1) { return } news_data.page = 0; $("#index-news-load").trigger("click"); } else { $("#index-news").html(response); } }) $i.css({ transition: "transform 1s", transform: "rotateZ(720deg)" }); setTimeout(function() { $i.removeAttr("style") }, 1000) }) //绉诲姩鏂伴椈鏁版嵁 let mobile_news_data = {}, isMobileAjax = false; $("#index-news-load-mobile").click(function() { if (isMobileAjax) { return } let $i = $(this).find("i"); if (mobile_news_data.page === undefined) { mobile_news_data.page = 1; } mobile_news_data.page++; isMobileAjax = true $.get('./tpl/index-news-mobile.php', mobile_news_data, function(response) { if (isMobileAjax) { isMobileAjax = false } if (response === "") { if (mobile_news_data.page === 1) { return } mobile_news_data.page = 0; $("#index-news-load-mobile").trigger("click"); } else { $("#index-news-mobile").html(response); } }) $i.css({ transition: "transform 1s", transform: "rotateZ(720deg)" }); setTimeout(function() { $i.removeAttr("style") }, 1000) }) // 澶氱铏氭嫙鍖栧钩鍙板浠 let reloadHtml = function() { // 澶囦唤鍔熻兘婊戝潡 let slidesPerView = $(window).width() <= 1199 ? 2 : 4; console.log(slidesPerView) new Swiper("#backup-swiper", { slidesPerView: slidesPerView, // 閲嶈 鍙互鍘籹wiper鎼滅储 spaceBetween: 24, autoplay: false, //鍙€夐€夐」锛岃嚜鍔ㄦ粦鍔 loop: true, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: '.swiper-next', prevEl: '.swiper-prev', } }) new Swiper("#backup-swiper-mobile", { slidesPerView: 1, // 閲嶈 鍙互鍘籹wiper鎼滅储 spaceBetween: 24, autoplay: false, //鍙€夐€夐」锛岃嚜鍔ㄦ粦鍔 loop: true, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: '.swiper-next', prevEl: '.swiper-prev', } }) new Swiper("#scenario-module-swiper", { slidesPerView: 2.4, // 閲嶈 鍙互鍘籹wiper鎼滅储 spaceBetween: 12, autoplay: false, //鍙€夐€夐」锛岃嚜鍔ㄦ粦鍔 loop: true, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: '.swiper-next', prevEl: '.swiper-prev', } }) $(".neo-type-module .display-website .programme").hover(function (){ var id = $(this).attr("data-id"); $(".display-website .programme").removeClass("active").addClass("gray"); $(this).addClass("active").removeClass("gray"); $(".programme-page").removeClass("active"); $(".programme-page-"+id).addClass("active"); }) $(".neo-type-module .display-mobile .programme").click(function (){ var id = $(this).attr("data-id"); $(".display-mobile .programme").removeClass("active").addClass("gray"); $(this).addClass("active").removeClass("gray"); $(".programme-page").removeClass("active"); $(".programme-page-"+id).addClass("active"); }) $(document).ready(function (){ new Swiper("#type-module-swiper", { // centeredSlides: true, slidesPerView: 1, // 閲嶈 鍙互鍘籹wiper鎼滅储 initialSlide: 0, observer: true, observeParents: true, direction: 'horizontal', spaceBetween: 0, autoplay: false, //鍙€夐€夐」锛岃嚜鍔ㄦ粦鍔 loop: true, pagination: { el: '.type-module-swiper-pagination', clickable: true, }, navigation: { nextEl: '.type-module-swiper-next', prevEl: '.type-module-swiper-prev', }, on:{ slideChangeTransitionEnd:function (){ $(".swiper-slide .industry-solution .solution-content .content").hide(); $(".swiper-slide-active .industry-solution .solution-content .content").fadeIn(); } } }) new Swiper("#industry-swiper", { // centeredSlides: true, slidesPerView: 2, // 閲嶈 鍙互鍘籹wiper鎼滅储 initialSlide: 0, observer: true, observeParents: true, direction: 'horizontal', spaceBetween: 30, autoplay: false, //鍙€夐€夐」锛岃嚜鍔ㄦ粦鍔 loop: true, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: '.swiper-next', prevEl: '.swiper-prev', }, on:{ slideChangeTransitionEnd:function (){ $(".swiper-slide .industry-solution .solution-content .content").hide(); $(".swiper-slide-active .industry-solution .solution-content .content").fadeIn(); } } }) new Swiper("#industry-swiper-mobile", { // centeredSlides: true, slidesPerView: 1, // 閲嶈 鍙互鍘籹wiper鎼滅储 initialSlide: 0, observer: true, observeParents: true, direction: 'horizontal', spaceBetween: 0, autoplay: true, //鍙€夐€夐」锛岃嚜鍔ㄦ粦鍔 loop: true, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: '.swiper-next', prevEl: '.swiper-prev', }, on:{ slideChangeTransitionEnd:function (){ $(".swiper-slide .industry-solution .solution-content .content").hide(); $(".swiper-slide-active .industry-solution .solution-content .content").fadeIn(); } } }) new Swiper("#microsoft-365-swiper", { // centeredSlides: true, slidesPerView: 1, // 閲嶈 鍙互鍘籹wiper鎼滅储 initialSlide: 0, observer: true, observeParents: true, direction: 'horizontal', spaceBetween: 30, autoplay: true, //鍙€夐€夐」锛岃嚜鍔ㄦ粦鍔 loop: true, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: '.swiper-next', prevEl: '.swiper-prev', }, on:{ slideChangeTransitionEnd:function (){ $(".swiper-slide .industry-solution .solution-content .content").hide(); $(".swiper-slide-active .industry-solution .solution-content .content").fadeIn(); } } }) new Swiper("#public-cloud-swiper", { // centeredSlides: true, slidesPerView: 1, // 閲嶈 鍙互鍘籹wiper鎼滅储 initialSlide: 0, observer: true, observeParents: true, direction: 'horizontal', spaceBetween: 30, autoplay: true, //鍙€夐€夐」锛岃嚜鍔ㄦ粦鍔 loop: true, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: '.swiper-next', prevEl: '.swiper-prev', }, on:{ slideChangeTransitionEnd:function (){ $(".swiper-slide .industry-solution .solution-content .content").hide(); $(".swiper-slide-active .industry-solution .solution-content .content").fadeIn(); } } }) new Swiper("#object-storage-service-swiper", { // centeredSlides: true, slidesPerView: 1, // 閲嶈 鍙互鍘籹wiper鎼滅储 initialSlide: 0, observer: true, observeParents: true, direction: 'horizontal', spaceBetween: 30, autoplay: true, //鍙€夐€夐」锛岃嚜鍔ㄦ粦鍔 loop: true, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: '.swiper-next', prevEl: '.swiper-prev', }, on:{ slideChangeTransitionEnd:function (){ $(".swiper-slide .industry-solution .solution-content .content").hide(); $(".swiper-slide-active .industry-solution .solution-content .content").fadeIn(); } } }) }) /* let height = $(window).height(); $('.copy-module').css('min-height', height); let width = document.body.clientWidth; let csswidth = parseInt($('.hypervisor-module').css('width')); let cssheight = parseInt($('.hypervisor-module').css('height')); let r = width / csswidth; //璁$畻缂╂斁姣斾緥 let currentHeight = parseInt(cssheight * r); $('.hypervisor-module').css("transform", "scale(" + r + ")"); $('.hypervisor-module').css("-webkit-transform", "scale(" + r + ")"); let marginBottom = cssheight - currentHeight; let value = -marginBottom; $('.hypervisor-module').css("margin-bottom", value); let copyImg = 1282; let copyWidth = Math.abs(r * copyImg); $('.copy-module img').width(copyWidth);*/ } let resize = function() { reloadHtml(); navFixed(); } resize(); // 閲嶅畾涓嬬獥鍙eぇ灏 window.onresize = function() { resize(); }; }); // 瀵艰埅鍥哄畾 let scrollFlag = false; jQuery(window).scroll(function() { if ($(".data-module").length != 0) { let dataCounter = $(".data-module").offset().top; if (dataCounter >= $(window).scrollTop() && dataCounter < ($(window).scrollTop() + $(window).height()) && !scrollFlag) { $(".data-module [data-counter='counterup']").counterUp({ delay: 10, time: 1000 }); scrollFlag = true; } } }); $(".scenario-card").click(function (){ let url = $(this).attr("data-url"); window.open(url); });