;( function ( $, window, document, undefined ){ // i01 $(function(){ //主动拓展出来的功能 // let cc_top = $(".index02").offset().top; var countCXArr = []; var countCX=function (){ // let sT1 =$(window).scrollTop(); $('.abCount').each(function(i, dom) { //控制上下滑动数字的重置 // if(sT1>cc_top-100 || sT1 < 500){ countCXArr[i] = false;} if(countCXArr[i] && countCXArr[i] === true){return;} var sT; var ncTop; sT = $(window).scrollTop(); ncTop = $(dom).offset().top; var id,decimals, startVal, endVal, duration; if($(window).width()<760){ return }else{ if (sT > ncTop-$(window).height() && sT < ncTop) { $(dom).find('.abnum').each(function(){ id=$(this).attr('id'); decimals = $(this).attr('data-decimals'), startVal = $(this).attr('data-startVal'), endVal = $(this).attr('data-endVal'), duration = $(this).attr('data-speed'); new CountUp(id, startVal, endVal, decimals, duration, { useEasing: true, separator: '' }).start(); countCXArr[i] = true; }) } } }) } countCX(); $(window).on("scroll",function() { countCX(); }) }); //ab03 let ab03Swiper = new Swiper ('.ab03Swiper', { watchSlidesProgress: true, // 如果需要分页器 pagination: { el: '.ab03Swiper-pagination', clickable: true, }, loop:true, slidesPerView: "1.8", centeredSlides: true, // 如果需要前进后退按钮 navigation: { nextEl: '.ab03Swiper-button-next', prevEl: '.ab03Swiper-button-prev', }, loopAdditionalSlides: 2, autoplay: { delay: 6000, stopOnLastSlide: false, disableOnInteraction: false, }, speed:1000, on: { progress: function(progress) { if($(window).width<760){ return } for (i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i); var slideProgress = this.slides[i].progress; var modify = 1; if (Math.abs(slideProgress) > 1) { modify = (Math.abs(slideProgress) - 1) * 0.3 + 1; } var translate = slideProgress * modify * 250 + 'px'; var scale = 1 - Math.abs(slideProgress) / 4; var zIndex = 999 - Math.abs(Math.round(10 * slideProgress)); slide.transform('translateX(' + translate + ') scale(' + scale + ')'); slide.css('zIndex', zIndex); slide.css('opacity', 1); if (Math.abs(slideProgress) >3) { slide.css('opacity', 0); } } }, setTransition: function(transition) { if($(window).width<760){ return } for (var i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i) slide.transition(transition); } } }, breakpoints: { 768: { //当屏幕宽度大于等于768 slidesPerView: 1, spaceBetween: 20 }, } }) // ab04 let ab04Swiper = new Swiper ('.ab04Swiper', { navigation: { nextEl: '.ab04Swiper-button-next', prevEl: '.ab04Swiper-button-prev', }, direction: 'vertical', speed:1000, spaceBetween:20, height: 300, autoplay: { delay: 6000, stopOnLastSlide: false, disableOnInteraction: false, }, on:{ slideChange: function(){ $(".ab04 .content .left dd").eq(this.activeIndex).trigger("click") }, }, breakpoints: { 1600: { height:270, }, 760: { height:270, } } }) $(".ab04 .content .left dd").click(function(){ let dex =$(this).index() $(this).addClass("active").siblings().removeClass("active") ab04Swiper.slideTo(dex, 1000, false); //鐧句綅 let n3 = $(this).find("span").html().substring(2,3) bai(n3) //鍗佷綅 let n4 = $(this).find("span").html().substring(3,4) qian(n4) }) //鐧句綅 function bai(num){ if(num==0){ $(".ab04 .content .mid .n3").css("top","0%") } if(num==1){ $(".ab04 .content .mid .n3").css("top","-100%") } if(num==2){ $(".ab04 .content .mid .n3").css("top","-200%") } } //鍗冧綅 function qian(num){ if(num==0){ $(".ab04 .content .mid .n4").css("top","0%") } if(num==1){ $(".ab04 .content .mid .n4").css("top","-100%") } if(num==2){ $(".ab04 .content .mid .n4").css("top","-200%") } if(num==3){ $(".ab04 .content .mid .n4").css("top","-300%") } if(num==4){ $(".ab04 .content .mid .n4").css("top","-400%") } if(num==5){ $(".ab04 .content .mid .n4").css("top","-500%") } if(num==6){ $(".ab04 .content .mid .n4").css("top","-600%") } if(num==7){ $(".ab04 .content .mid .n4").css("top","-700%") } if(num==8){ $(".ab04 .content .mid .n4").css("top","-800%") } if(num==9){ $(".ab04 .content .mid .n4").css("top","-900%") } } function Pvi (obj){ $(obj.target).click(function(){ var src= $(obj.source).attr("src"); $(".vi_box video").attr("src",src) $(".vi_box video").trigger("play") $(".vi_box").fadeIn(); }) $(".vi_box .close").click(function(){ $(".vi_box video").attr("src","") $(".vi_box video").trigger("pause") $(".vi_box").fadeOut(); }) } //ab06 $(document).mousedown(function(e) { if ($(e.target).parent(".imgshowmask").length == 0) { $(".imgshowmask").fadeOut(); } }) let ab06_1Swiper = new Swiper ('.ab06_1Swiper', { loop:true, slidesPerView: 5.4, loopedSlides:20, spaceBetween:27, autoplay: { delay: 1, stopOnLastSlide: false, disableOnInteraction: false, }, loopAdditionalSlides: 3, allowTouchMove: false, speed:8000, centeredSlides: true, on: { slideChangeTransitionStart: function(){ $(".ab06 .content .g .box").click(function(){ var src = $(this).find(".imgbox img").attr("src"); $("#bigimg").attr("src", src); $(".imgshowmask").fadeIn(); }); }, }, breakpoints: { 768: { slidesPerView: 1.7, spaceBetween: 14, }, 1600: { slidesPerView: 4.4, spaceBetween: 20 }, 1280: { slidesPerView: 2.4, spaceBetween: 20 }, } }) let ab06_2Swiper = new Swiper ('.ab06_2Swiper', { loop:true, slidesPerView: 5.4, loopedSlides:20, spaceBetween:27, autoplay: { delay: 1, stopOnLastSlide: false, disableOnInteraction: false, reverseDirection: true, }, loopAdditionalSlides: 3, speed:10000, allowTouchMove: false, centeredSlides: true, on: { slideChangeTransitionStart: function(){ $(".ab06 .content .g .box").click(function(){ var src = $(this).find(".imgbox img").attr("src"); $("#bigimg").attr("src", src); $(".imgshowmask").fadeIn(); }); }, }, breakpoints: { 768: { slidesPerView: 1.7, spaceBetween: 14, }, 1600: { slidesPerView: 4.4, spaceBetween: 20 }, 1280: { slidesPerView: 2.4, spaceBetween: 20 }, } }) let ab06_3Swiper = new Swiper ('.ab06_3Swiper', { loop:true, slidesPerView: 5.4, loopedSlides:20, spaceBetween:27, allowTouchMove: false, autoplay: { delay: 1, stopOnLastSlide: false, disableOnInteraction: false, }, loopAdditionalSlides: 3, speed:8000, centeredSlides: true, breakpoints: { 768: { slidesPerView: 1.7, spaceBetween: 14, }, 1600: { slidesPerView: 4.4, spaceBetween: 20 }, 1280: { slidesPerView: 2.4, spaceBetween: 20 }, } }) //ab07 let wi =0; $(window).scroll(function(){ let winH= $(window).height() let t1 = ($(".ab07").offset().top + (winH - 85)) let t2 = ($(".ab07").offset().top + (winH - 85)*2) let ab_c=document.documentElement.scrollTop||document.body.scrollTop; if(ab_c > t1 && ab_c < t2){ wi= (100/(winH - 85))*(ab_c-t1) }else if(ab_c t2){ wi=100 } $(".ab07 .g .hide").css("width",`${wi}vw`) }) //ab08 new Pvi({ target:".ab08 .bot .bo", source:".ab08 .bot video source" }) })(jQuery,window,document);