//var ws=$(".rolls").width()/2; $(function () { /*关闭*/ $(".close20").click(function(){ $(this).closest("li").hide(); }); /*吉祥物滚动*/ if($(".invests-wrap").size()>0){ if($(window).width()>640){ var svars=$(".invests-wrap").width()/6; $(window).resize(function(){ var svars=$(".invests-wrap").width()/6; }); invest2 = new Swiper('#invest1 .swiper-container', { watchSlidesProgress: true, slidesPerView: 'auto', centeredSlides: true, loop: true, loopedSlides:5, autoplay: true, navigation: { nextEl: '#invest1 .swiper-button-next', prevEl: '#invest1 .swiper-button-prev', }, pagination: { el: '.swiper-pagination', //clickable :true, }, on: { progress: function(progress) { for (i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i); var slideProgress = this.slides[i].progress; modify = 1; if (Math.abs(slideProgress) > 1) { modify = (Math.abs(slideProgress) - 1) * .1 + 1; } /*230*/ translate = slideProgress * modify * svars + 'px'; scale = 1 - Math.abs(slideProgress) / 4; 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) { for (var i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i) slide.transition(transition); } } } }); } else{ var svars=$(".invests-wrap").width()/3; $(window).resize(function(){ var svars=$(".invests-wrap").width()/3; }); invest2 = new Swiper('#invest1 .swiper-container', { watchSlidesProgress: true, slidesPerView: 'auto', centeredSlides: true, loop: true, loopedSlides:5, autoplay: true, navigation: { nextEl: '#invest1 .swiper-button-next', prevEl: '#invest1 .swiper-button-prev', }, pagination: { el: '.swiper-pagination', //clickable :true, }, on: { progress: function(progress) { for (i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i); var slideProgress = this.slides[i].progress; modify = 1; if (Math.abs(slideProgress) > 1) { modify = (Math.abs(slideProgress) - 1) * .2 + 1; } /*230*/ translate = slideProgress * modify * svars + 'px'; scale = 1 - Math.abs(slideProgress) / 2; 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) { for (var i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i) slide.transition(transition); } } } }); /*var invest2 = new Swiper('#invest1 .swiper-container', { slidesPerView:1, autoplay: { delay: 4000, stopOnLastSlide: false, disableOnInteraction: true, }, navigation: { }, loop:true, });*/ } } /*荣誉墙*/ $(".kjcg-roll .item-cell").each(function(){ if($(this).width()>$(this).height()){ $(this).addClass("kjjxbg"); } }); document.addEventListener("WeixinJSBridgeReady", function() { if($("#myVideo1").size()>0) document.getElementById("myVideo1").play(); if($("#myVideo2").size()>0) document.getElementById("myVideo2").play(); if($("#myVideo3").size()>0) document.getElementById("myVideo3").play(); }, false); //产品切换 $(".promytabs a").hover(function(){ $(".promytabs a").removeClass("ac-active"); $(this).addClass("ac-active"); $(".promytabs-cnt").removeClass("pr-active"); $(".promytabs-cnt:eq("+$(this).index()+")").addClass("pr-active"); }); /*语言版本*/ $(".lang-box").width($(window).width()); $(window).resize(function(){ $(".lang-box").width($(window).width()); }); $(".lang-links").hover(function(){ $(".lang-box").height($(".inners-lang-box").height()+100); },function(){$(".lang-box").height(0); }); /*网站地图*/ $(".siteMap>ul>li").each( function(){ var sthis=$(this); if(sthis.find("ul li").has("dl").length>0){ sthis.addClass("menulevels"); } } ); /*首页轮播视频广告*/ function detectZoom(){ let ratio = 0, screen = window.screen, ua = navigator.userAgent.toLowerCase(); if (window.devicePixelRatio !== undefined) { ratio = window.devicePixelRatio; } else if (~ua.indexOf('msie')) { if (screen.deviceXDPI && screen.logicalXDPI) { ratio = screen.deviceXDPI / screen.logicalXDPI; } } else if ( window.outerWidth !== undefined && window.innerWidth !== undefined ) { ratio = window.outerWidth / window.innerWidth; } if (ratio) { ratio = Math.round(ratio * 100); } return ratio; }; const m = detectZoom(); if((m>100&&m<200)){ document.body.style.zoom = 100*1.2/Number(m); /*$("#rolls").height($(window).height()*m/120);*/ $("#rolls").css({maxHeight:$(window).height()*m/120}); $(".swiper-roll-28").css({top:$(window).height()*m/120/2}); $(".lang-box").width($(window).width()*m/120); $(window).resize(function(){ $(".lang-box").width($(window).width()*m/120); }); if(navigator.userAgent.toLowerCase().indexOf("firefox") > 0) {/*$("#rolls").height($(window).height())*/ $(".lang-box").width($(window).width()); $("#rolls").css({maxHeight:$(window).height()}); $(".swiper-roll-28").css({top:$(window).height()/2}); }; $(window).resize(function () { /*$("#rolls").height($(window).height()*m/120)*/ $("#rolls").css({maxHeight:$(window).height()*m/120}); $(".swiper-roll-28").css({top:$(window).height()*m/120/2}); if(navigator.userAgent.toLowerCase().indexOf("firefox") > 0) {/*$("#rolls").height($(window).height())*/ $("#rolls").css({maxHeight:$(window).height()}); $(".swiper-roll-28").css({top:$(window).height()/2}); $(".lang-box").width($(window).width()); }; }); } else{ /*$("#rolls").height($(window).height());*/ $("#rolls").css({maxHeight:$(window).height()}); $(".swiper-roll-28").css({top:$(window).height()/2}); $(window).resize(function () { /*$("#rolls").height($(window).height());*/ $("#rolls").css({maxHeight:$(window).height()}); $(".swiper-roll-28").css({top:$(window).height()/2}); }); } //屏蔽错误 function killerrors() { return true; } window.onerror = killerrors; /*顶部导航固定*/ $(window).scroll(function () { if ($(window).scrollTop() > 0) $(".index-header").addClass("fixedheader") else if ($('.navbg').height() == 0 && $(window).scrollTop() == 0) $(".index-header").removeClass("fixedheader"); }); /*下拉框*/ $(".mod-serch-l:not('.btn-group')").each(function () { $(this).click(function (event) { event.stopPropagation(); $(this).find("ul").show(); }); $(this).find("li").click(function (event) { event.stopPropagation(); $(this).parent().parent().find("span").text($(this).text()); $(this).parent("ul").hide(); event.stopPropagation(); }); }); $(document).click(function () { $(".mod-serch-l ul").hide(); }); /*发展历程展开*/ $(".his-more").click(function(){ $(".his-more a").toggleClass("icon-up"); $(".hislists").toggleClass("hislistsdowns"); }); /*$(".navMenu>li:nth-last-child(1)>a").removeAttr("href");*/ //手机端导航 $(".sub-sec .iconfont").click(function(){$(this).closest(".sub-sec").toggleClass("sub-sec2");}); /*产品最终页图片切换*/ $(".small-img span").hover(function(){ $(".small-img span").removeClass("active"); $(this).addClass("active"); $(".xmproinfos-wrap .itemimgs img").attr("src", $(this).find("img").attr("src")); }); /*科研平台切换*/ $(".tech-tab li").hover(function () { $(".tech-tab li").removeClass("labsactive"); $(this).addClass("labsactive"); $(".plat-cell").hide(); $(".plat-cell:eq(" + $(this).index() + ")").show(); }); /*经销商案例查询切换*/ $(".case-tabs a").hover(function () { $(".case-tabs a").removeClass("cr"); $(this).addClass("cr"); $(".infocases").removeClass("cas-active"); $(".infocases:eq(" + $(this).index() + ")").addClass("cas-active"); }); /*创新历程滚动*/ if($(".swiper-yearsroll").size()>0){ var swiperyearsroll = new Swiper('.swiper-yearsroll', { slidesPerView:(window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 1 : 1, direction: 'vertical', autoplay: true, navigation: { // nextEl: '.career-photowrap .swiper-button-prev', //prevEl: '.career-photowrap .swiper-button-next', }, loop:true, }); } /*科技成果荣誉资质*/ kjcgroll = new Swiper('.kjcg-roll', { watchSlidesProgress: true, slidesPerView: 'auto', centeredSlides: true, loop: true, loopedSlides: 3, autoplay: true, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, pagination: { el: '.swiper-pagination', //clickable :true, }, on: { progress: function(progress) { for (i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i); var slideProgress = this.slides[i].progress; modify = 1; if (Math.abs(slideProgress) > 1) { modify = (Math.abs(slideProgress) - 1) * 0.3 + 1; } translate = slideProgress * modify * 105 + 'px'; scale = 1 - Math.abs(slideProgress) / 3; 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) > 1) { slide.css('opacity', 0); } } }, setTransition: function(transition) { for (var i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i) slide.transition(transition); } } } }); //加入冰球突破图集 var photoroll = new Swiper('.photoroll', { slidesPerView:(window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 3 : 1, navigation: { nextEl: '.career-photowrap .swiper-button-prev', prevEl: '.career-photowrap .swiper-button-next', }, loop:true, }); //活动预告滚动 if($(".activeroll .swiper-wrapper .item-core").size()>1){ $(".active-rollwrap .swiper-button-prev,.active-rollwrap .swiper-button-next").show(); var activeroll = new Swiper('.activeroll', { slidesPerView:1, autoplay: { delay: 4000, stopOnLastSlide: false, disableOnInteraction: true, }, navigation: { nextEl: '.active-rollwrap .swiper-button-prev', prevEl: '.active-rollwrap .swiper-button-next', }, loop:true, }); } /*二级导航菜单*/ $(".sub0").each(function () { var mythis=$(this); $(this).find(".nsub ul li").hover(function(){ mythis.find(".nsub ul li").removeClass("subhover"); $(this).addClass("subhover"); }); }); $(".sub-lefts li").hover(function () { $(".sub-lefts li").removeClass("cr"); $(this).addClass("cr"); $(".sub-infos").hide(); $(".sub-infos:eq(" + $(this).index() + ")").show(); }); $(".navMenu>li").hover(function (event) { event.stopPropagation(); var sthis = $(this); var index = $(this).index(); //console.log(index); sthis.addClass("moveEvent"); setTimeout(function () { if (sthis.hasClass("moveEvent")) { sthis.addClass("hovers"); //$(".subs:eq(0)").fadeIn(300); $(".sub0:eq(" + index + ")").addClass("myssubs2"); $(".sub0:eq(" + index + ")").height($(".sub0:eq(" + index + ")").find(".wrap-layer").outerHeight()); } }, 200); }, function (event) { event.stopPropagation(); var sthis = $(this); var index = $(this).index(); //console.log(index); sthis.removeClass("moveEvent"); setTimeout(function () { if (!sthis.hasClass("moveEvent")) { sthis.removeClass("hovers"); $(".sub0:eq(" + index + ")").removeClass("myssubs2"); $(".sub0:eq(" + index + ")").height(0); } }, 200); }); $(".sub0").hover(function (event) { event.stopPropagation(); var sthis = $(this); var index = $(this).index(); //console.log(index); sthis.addClass("moveEvent"); setTimeout(function () { if (sthis.hasClass("moveEvent")) { sthis.addClass("hovers"); //$(".subs:eq(0)").fadeIn(300); sthis.addClass("myssubs2"); sthis.height(sthis.find(".wrap-layer").outerHeight()); } }, 200); }, function (event) { event.stopPropagation(); var sthis = $(this); var index = $(this).index(); //console.log(index); sthis.removeClass("moveEvent"); setTimeout(function () { if (!sthis.hasClass("moveEvent")) { sthis.removeClass("hovers"); sthis.removeClass("myssubs2"); sthis.height(0); } }, 200); }); /*智能工程*/ var facroll2 = new Swiper('.facroll2', { slidesPerView:1, navigation: { nextEl: '.mod-facroll .fac-bt1', prevEl: '.mod-facroll .fac-bt2', }, loop:true, }); /*创新历程*/ $(".creat-lefts ul li").hover(function(){ $(".creat-lefts ul li").removeClass("active"); $(this).addClass("active"); $(".creat-right .creat-info").hide(); $(".creat-right .creat-info:eq("+$(this).index()+")").show(); }); // 推荐案例 var caseroll = new Swiper('.caseroll', { slidesPerView:(window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 3 : 1, navigation: { nextEl: '.casewraps .bt-l', prevEl: '.casewraps .bt-r', }, loop:true, }); // 质量把控 $(".qualit-wrap .item-cell").hover(function(){ $(".qualit-wrap .item-cell").removeClass("qua-active"); $(this).addClass("qua-active"); }); // 荣誉 $("#myhors .item-pic").removeClass("auto-img"); var horsroll1 = new Swiper('#myhors .swiper-container', { slidesPerView:1, navigation: { nextEl: '#myhors .kj-bt1', prevEl: '#myhors .kj-bt2', }, loop:true, }); $(document).imagesLoaded( function() { $("#myhors .swiper-slide").each(function(){ if($(this).find(".item-img2 .item-pic img").width()>$(this).find(".item-img2 .item-pic img").height()){ $(this).addClass("kjjxbg2"); } }); } ) // 科技维度 $(".kjui-tab ul li").hover(function(){ $(".kjui-tab ul li").removeClass("cr"); $(this).addClass("cr"); $(".tech-info").removeClass("tech-active"); $(".tech-info:eq("+$(this).index()+")").addClass("tech-active"); }); var techroll1 = new Swiper('#kj1 .swiper-container', { slidesPerView:1, navigation: { nextEl: '#kj1 .kj-bt1', prevEl: '#kj1 .kj-bt2', }, on: { slideChangeTransitionEnd: function (realIndex) { // alert(this.realIndex); $("#kj1 .btnums span").text(this.realIndex+1); // $("#kj1 .btnums span").text(this.realIndex); } }, loop:true, }); var techroll2 = new Swiper('#kj2 .swiper-container', { slidesPerView:1, navigation: { nextEl: '#kj2 .kj-bt1', prevEl: '#kj2 .kj-bt2', }, on: { slideChangeTransitionEnd: function (realIndex) { // alert(this.realIndex); $("#kj2 .btnums span").text(this.realIndex+1); // $("#kj1 .btnums span").text(this.realIndex); } }, loop:true, }); var techroll3 = new Swiper('#kj3 .swiper-container', { slidesPerView:1, navigation: { nextEl: '#kj3 .kj-bt1', prevEl: '#kj3 .kj-bt2', }, on: { slideChangeTransitionEnd: function (realIndex) { // alert(this.realIndex); $("#kj3 .btnums span").text(this.realIndex+1); // $("#kj1 .btnums span").text(this.realIndex); } }, loop:true, }); var techroll3 = new Swiper('#kj4 .swiper-container', { slidesPerView:1, navigation: { nextEl: '#kj4 .kj-bt1', prevEl: '#kj4 .kj-bt2', }, on: { slideChangeTransitionEnd: function (realIndex) { // alert(this.realIndex); $("#kj4 .btnums span").text(this.realIndex+1); // $("#kj1 .btnums span").text(this.realIndex); } }, loop:true, }); // 相关案例 var caserolls = new Swiper('.caserolls', { slidesPerView:(window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 2 : 1, navigation: { nextEl: '#case .bt-l', prevEl: '#case .bt-r', }, loop:true, // effect : 'fade', //autoplay: true, }); // 系列产品 // var prosrolls = new Swiper('.prosrolls', { // slidesPerView:(window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 3 : 1, // navigation: { // nextEl: '#syspro1 .bt-l', // prevEl: '#syspro1 .bt-r', // }, // loop:true, // // }); // 项目工程滚动 var promySwiper = new Swiper('.preview .swiper-container', { slidesPerView: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 4 : 3, navigation: { nextEl: '.arrow-right', prevEl: '.arrow-left', }, loop:false, // effect : 'fade', //autoplay: true, }); $(".preview .swiper-slide").hover(function () { $(".view img").attr("src", $(this).find("img").attr("src")); $(".view img").attr("data-large", $(this).find("img").attr("src")); $(".preview .swiper-slide").removeClass("actives"); $(this).addClass("actives"); }); /*数字滚动*/ if($('.counter').size()>0) {$('.counter').countUp();} /*首页见闻滚动*/ var newsroll = new Swiper('.newsroll', { slidesPerView: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 3 : 1, loop: true, // autoplay: { // delay: 4000, // stopOnLastSlide: false, // disableOnInteraction: true, // }, autoplay: false, }); $(".arr.bt-l").click(function () { //swiper2.swipePrev(); newsroll.slidePrev(); }); $(".arr.bt-r").click(function () { newsroll.slideNext(); }); /*专利滚动*/ var expertroll = new Swiper('.expertroll', { slidesPerView: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 1 : 1, loop: true, autoplay: { delay: 3000, stopOnLastSlide: false, disableOnInteraction: false, }, pagination: { el: '.item-nums .swiper-pagination', clickable :true, }, on: { slideChangeTransitionStart: function() { $(".rolllodings").removeClass("actives"); }, slideChangeTransitionEnd: function() { $(".rolllodings").addClass("actives"); }, } }); /*员工风采滚动*/ function rolls20(i) { var a = "#yg-" + i + " .swiper-container"; var b = "#yg-" + i + " .swiper-button-prev"; var c = "#yg-" + i + " .swiper-button-next"; //var d1="#style-"+i+" .swiper-pagination"; var f1 = "rollstyle" + i; var projectwd = $("#style-" + i + " .rp-proroll-2 .item-cell").width() / 3.4 //$(window).resize(function(){ //projectwd= $("#style-"+i+" .item-cell").width()/3.4 //}); //var b="styleroll"+i; f1 = new Swiper(a, { watchSlidesProgress: true, slidesPerView: 'auto', centeredSlides: true, loop: false, loopedSlides: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 3 : 3, autoplay: false, observer: true, observeParents: true, navigation: { nextEl: c, prevEl: b, }, pagination: { //el: '.swiper-pagination', //clickable :true, }, on: { slideChangeTransitionEnd: function () {}, } }); //f1.slideTo(1, 0, false); /*$(b).click(function(){ f1.swipePrev(); }); $(c).click(function(){ f1.swipeNext(); }); */ } if ($(".mod-ygfcs .item-cell").size() > 0) { for (var a = 1; a < $(".mod-ygfcs .item-cell").size() + 1; a++) { rolls20(a); //$(window).resize(function(){rolls(a);}); } } /*办公室空间滚动*/ var worksroom = new Swiper('.worksroom-right .swiper-container', { slidesPerView: 1, loop: true, autoplay: { delay: 4000, stopOnLastSlide: false, disableOnInteraction: true, }, }); $(".worksroom.bt-l").click(function () { //swiper2.swipePrev(); worksroom.slidePrev(); }); $(".worksroom.bt-r").click(function () { worksroom.slideNext(); }); /*首页新闻轮播*/ var swiper30 = new Swiper('#rolls5 .swiper-roll-4', { slidesPerView: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 3 : 1, loop: true, autoplay: { delay: 3000, stopOnLastSlide: false, disableOnInteraction: true, }, }); $(".mysnews .arrs:eq(0) span:eq(0)").click(function () { //swiper2.swipePrev(); swiper30.slidePrev(); }); $(".mysnews .arrs:eq(0) span:eq(1)").click(function () { swiper30.slideNext(); }); var swiper31 = new Swiper('#rolls6 .swiper-roll-4', { slidesPerView: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 3 : 1, loop: true, autoplay: { delay: 3000, stopOnLastSlide: false, disableOnInteraction: true, }, }); $(".mysnews .arrs:eq(1) span:eq(0)").click(function () { //swiper2.swipePrev(); swiper31.slidePrev(); }); $(".mysnews .arrs:eq(1) span:eq(1)").click(function () { swiper31.slideNext(); }); $(".newstabs a").hover(function () { $(".newstabs a").removeClass("cr"); $(this).addClass("cr"); $(".news-rolls3").removeClass("actives"); $(".news-rolls3:eq(" + $(this).index() + ")").addClass("actives"); $(".mysnews .arrs").hide(); $(".mysnews .arrs:eq(" + $(this).index() + ")").show(); }); if($(".swiper-roll-28 .item-cell").size()>0){ var totalsize=$(".swiper-roll-28 .item-cell").size(); var Timer=null; }; var swiper260 = new Swiper('.swiper-roll-28', { slidesPerView: 1, loop:false, // effect: 'fade', autoplay: { delay:17000, stopOnLastSlide: false, disableOnInteraction: false, }, //autoplay: false, pagination: { // el: '#rolls .swiper-pagination', //el: '.tabpic', clickable: true, }, on: { slideChangeTransitionStart: function () { /*document.getElementById('myVideo2').currentTime = 0; document.getElementById('myVideo1').currentTime = 0; document.getElementById('myVideo3').currentTime = 0; */ // console.log(this.activeIndex); //alert(this.activeIndex); if(this.activeIndex==0) { document.getElementById('myVideo2').currentTime = 0; clearTimeout(Timer); Timer=setTimeout(function(){ swiper260.slideTo(1, 0, true);},8000);} if(this.activeIndex==1) { document.getElementById('myVideo3').currentTime = 0; clearTimeout(Timer); Timer=setTimeout(function(){ swiper260.slideTo(2, 0, true);},11000); } if(this.activeIndex==2) { clearTimeout(Timer); Timer=setTimeout(function(){swiper260.slideTo(3,0, true);},17000); } if(this.activeIndex==3) { clearTimeout(Timer); Timer=setTimeout(function(){swiper260.slideTo(4,0, true);},4000); } if(this.activeIndex>=4&&this.activeIndex0){ Timer=setTimeout(function(){swiper260.slideTo(1, 0, true);},8000);} //clearTimeout(Timer1); $(document).on("click", "#rolls .swiper-pagination-bullet", function () { $("#rolls .swiper-pagination-bullet ").removeClass("swiper-pagination-bullet-active"); $(this).addClass("swiper-pagination-bullet-active"); swiper260.slideTo($(this).index(), 0, true); //clearTimeout(Timer); }); $(".tabpic span").click(function () { $(".tabpic span").removeClass("active"); $(this).addClass("active"); //alert(); // document.getElementById('myVideo').currentTime = 0; // document.getElementById('myVideo1').currentTime = 0; // swiper260.slideTo($(this).index(), 1000, false); }); /*视频弹出层*/ $(".video-close").click(function () { $(".modvideo-layer").hide(); document.getElementById('my-video2').pause(); }); $(".mod-rpabout .item-videos").click(function () { $(".modvideo-layer").show(); document.getElementById('my-video2').currentTime = 0; document.getElementById('my-video2').play(); }); /*产品参数更多*/ $(".param-more").click(function () { $(".sigles-param,.all-param").toggle(); $(".param-more").toggleClass("paramfolds"); }); /*大事记*/ var rollevent = new Swiper('#eventroll', { slidesPerView: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 5 : 2, //slidesPerGroup : (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 5 : 2, autoplayDisableOnInteraction: false, autoplay: false, // pagination: '.swiper-container-10 .swiper-pagination', loop: false, grabCursor: true, //spaceBetween :(window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 30 : 10, paginationClickable: true }); $('.mod-adbtns3 .btnl').on('click', function (e) { e.preventDefault(); // rollevent.swipePrev(); rollevent.slidePrev(); }); $('.mod-adbtns3 .btnr').on('click', function (e) { e.preventDefault(); // rollevent.swipeNext(); rollevent.slideNext(); }); $("#eventroll .item-year").hover(function () { $("#eventroll .item-year").removeClass("cr"); $("#eventroll .item-year:eq(" + $(this).index() + ")").addClass("cr"); $(".info-events").hide(); $(".info-events:eq(" + $(this).index() + ")").show(); }); /*应用手册*/ var pdfroll = new Swiper('.mod-pdfroll', { slidesPerView: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 2 : 1, loop: false, autoplay: { delay: 3000, stopOnLastSlide: false, disableOnInteraction: true, }, pagination: { el: '.mod-pdfroll .swiper-pagination', clickable: true, }, }); /*仪器产品滚动循环*/ function rolls(i) { var a = "#style-" + i + " .rp-proroll-2"; var b = "#style-" + i + " .bt-l"; var c = "#style-" + i + " .bt-r"; var d1 = "#style-" + i + " .swiper-pagination"; var f1 = "rollstyle" + i; var projectwd = $("#style-" + i + " .rp-proroll-2 .item-cell").width() / 3.4 //$(window).resize(function(){ //projectwd= $("#style-"+i+" .item-cell").width()/3.4 //}); //var b="styleroll"+i; f1 = new Swiper(a, { watchSlidesProgress: true, slidesPerView: 'auto', centeredSlides: true, loop: false, loopedSlides: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 3 : 3, autoplay: false, observer: true, observeParents: true, navigation: { nextEl: c, prevEl: b, }, pagination: { //el: '.swiper-pagination', //clickable :true, }, on: { slideChangeTransitionEnd: function () {}, progress: function (progress) { for (i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i); var slideProgress = this.slides[i].progress; modify = 1; if (Math.abs(slideProgress) > 1) { modify = (Math.abs(slideProgress) - 1) * 0.3 + 1; } translate = (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? slideProgress * modify * projectwd + 'px' : slideProgress * modify * 80 + 'px'; scale = (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 1 - Math.abs(slideProgress) / 2 : 1 - Math.abs(slideProgress) / 3; 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) > 5) { slide.css('opacity', 0); } } }, setTransition: function (transition) { for (var i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i) slide.transition(transition); } } } }); f1.slideTo(1, 0, false); /*$(b).click(function(){ f1.swipePrev(); }); $(c).click(function(){ f1.swipeNext(); }); */ } if ($(".protab-type2 li").size() > 0) { for (var a = 1; a < $(".protab-type2 li").size() + 1; a++) { rolls(a); //$(window).resize(function(){rolls(a);}); } } $(".protab-type2 li").hover(function () { $(".protab-type2 li").removeClass("cr"); $(this).addClass("cr"); $(".pro-cellinfo2").removeClass("p-active"); $(".pro-cellinfo2:eq(" + $(this).index() + ")").addClass("p-active"); }); /*产品表格*/ if ($("#tbodyZone").size() > 0) { let tds = document.querySelectorAll('.td-1'); let theads = document.getElementById("theadtr"); let theadth = document.getElementById("theadth"); document.getElementById("tbodyZone").addEventListener("scroll", function (event) { let offsetleft = event.target.scrollLeft; tds.forEach(function (td, index) { td.style.transform = 'translateX(' + offsetleft + 'px)'; }); theads.style.transform = 'translateX(-' + offsetleft + 'px)'; theadth.style.transform = 'translateX(' + offsetleft + 'px)'; }); $(".mod-param #tbodyZone td").hover(function () { var myindex = $(this).index(); $('.mod-param #tbodyZone tr').each(function () { $(this).find("td:eq(" + myindex + ")").addClass("showdows"); }); }, function () { var myindex = $(this).index(); $('.mod-param #tbodyZone tr').each(function () { $(this).find("td:eq(" + myindex + ")").removeClass("showdows"); }); }); } /*首页产品滚动*/ function rolls2(i) { var a = "#pstyle-" + i + " .rp-proroll-1"; var b = "#pstyle-" + i + " .bt-l"; var c = "#pstyle-" + i + " .bt-r"; var d1 = "#pstyle-" + i + " .swiper-pagination"; var f1 = "prollstyle" + i; //var b="styleroll"+i; f1 = new Swiper(a, { slidesPerView: 2, loop: true, navigation: { nextEl: c, prevEl: b, }, autoplay: { delay: 3000, stopOnLastSlide: false, disableOnInteraction: true, } }); } if ($(".protab-type li").size() > 0) { for (var a = 1; a < $(".protab-type li").size() + 1; a++) { rolls2(a); } } $(".protab-type li").hover(function () { $(".protab-type li").removeClass("cr"); $(this).addClass("cr"); $(".pro-cellinfo").removeClass("active"); $(".pro-cellinfo:eq(" + $(this).index() + ")").addClass("active"); }); /*var rppro = new Swiper('.rp-proroll-1', { slidesPerView:2, loop : true, autoplay: { delay: 3000, stopOnLastSlide: false, disableOnInteraction: true, }, }); $(".pro-cellinfo:eq(0) .rp-bt .bt-l").click(function(){ //swiper2.swipePrev(); rppro.slidePrev(); }); $(".pro-cellinfo:eq(0) .rp-bt .bt-r").click(function(){ rppro.slideNext(); }); */ var applyroll = new Swiper('.mod-applyroll', { slidesPerView: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 7 : 2, loop: false, autoplay: false, }); $(".rp-bt1 .bt-l").click(function () { //swiper2.swipePrev(); applyroll.slidePrev(); }); $(".rp-bt1 .bt-r").click(function () { applyroll.slideNext(); }); if ($(".mod-applyroll").size() > 0) { applyroll.slideTo($(".mod-applyroll .item-cell").index($(".mod-applyroll .active"))); } $("#apsolve .item-cell").hover(function () { $("#apsolve .item-cell").removeClass("active"); $("#apsolve .item-cell:eq(" + $(this).index() + ")").addClass("active"); $(".applypic-infos").removeClass("apps-active"); $(".applypic-infos:eq(" + $(this).index() + ")").addClass("apps-active"); }); var swiper20 = new Swiper('.swiper-roll-20', { slidesPerView: 1, autoplay: { delay: 3000, stopOnLastSlide: false, disableOnInteraction: true, }, pagination: { el: '.swiper-roll-20 .swiper-pagination', clickable: true, }, }); /*768搜索框*/ /*导航*/ $(".s-close").click(function () { $(".mobile-search").hide(); }); $(".search-mobile").click(function () { $(".mobile-search").show(); }); /*手机导航菜单*/ var isfir = 1; var isfir1 = 1; $(".menus-mobiles").click(function () { $(".menus-mobiles").toggleClass("menus-ani1"); if (isfir) { $(".mobile-menucss:eq(0)").addClass("menu-active"); isfir1 = 1 $(".mobile-menucss:eq(1)").removeClass("menu-hide menu-active"); // $(".menus").addClass("menus-close"); isfir = 0; } else { if (isfir == 0) { $(".mobile-menucss:eq(0)").toggleClass("menu-active"); $(".mobile-menucss:eq(0)").toggleClass("menu-hide"); isfir1 = 1 $(".mobile-menucss:eq(1)").removeClass("menu-hide menu-active"); //$(".menus").toggleClass("menus-close"); } } }); $(".head-icons .icon-shouye").click(function () { if (isfir1) { $(".mobile-menucss:eq(1)").addClass("menu-active"); isfir = 1 $(".mobile-menucss:eq(0)").removeClass("menu-hide menu-active"); // $(".menus").addClass("menus-close"); isfir1 = 0; } else { if (isfir1 == 0) { $(".mobile-menucss:eq(1)").toggleClass("menu-active"); $(".mobile-menucss:eq(1)").toggleClass("menu-hide"); isfir = 1 $(".mobile-menucss:eq(0)").removeClass("menu-hide menu-active"); //$(".menus").toggleClass("menus-close"); } } }); var projectscase = new Swiper('.projectscase-roll', { slidesPerView: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 3 : 1, autoplayDisableOnInteraction: false, autoplay: false, loop: true //calculateHeight:true, //paginationClickable: true }); $(".projectscase-wrap2 .bt-4").click(function () { projectscase.slidePrev(); //projectscase.swipePrev(); }); $(".projectscase-wrap2 .bt-5").click(function () { projectscase.slideNext(); //projectscase.swipeNext(); }); var prorolls = new Swiper('.pro-rolls', { slidesPerView: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 3 : 1, autoplayDisableOnInteraction: false, autoplay: false, loop: true //calculateHeight:true, //paginationClickable: true }); $(".prolists-wrap2 .bt-4").click(function () { prorolls.slidePrev(); //projectscase.swipePrev(); }); $(".prolists-wrap2 .bt-5").click(function () { prorolls.slideNext(); //projectscase.swipeNext(); }); if ($("#fullpage").size() > 0) { var myFullpage = new fullpage('#fullpage', { verticalCentered: true, scrollingSpeed: 1200, loopBottom: false, loopTop: false // anchors: ['anchor1', 'anchor2', 'anchor3', 'anchor4','anchor5','anchor6','anchor7'], }); } /*首页banner图*/ if ($(window).width() > 480) { $("#index_banner").height($(window).height()); $(window).resize(function () { $("#index_banner").height($(window).height()); }); } /*导航*/ var navH = new Array(); $(".navMenu>li").each(function (i) { navH[i] = $(this).find(".sub-menus").height(); }); $(".sub-menus").css({ "height": 0 }); $(".navMenu>li").hover(function () { //$(this).find(".sub-menus").slideDown(); $(this).find(".sub-menus").height(navH[$(this).index()]); }, function () { $(this).find(".sub-menus").height(0); //$(this).find(".sub-menus").slideUp(); }); /*搜索框下拉*/ $(".t-search").click(function () { $(".in-search").slideToggle(); $(".index-header").addClass("index-header2"); }); $(".in-search em").click(function () { $(".in-search").slideToggle(); if ($(window).scrollTop() == 0) $(".index-header").removeClass("index-header2"); }); var swiper1 = new Swiper('.swiper-roll-1', { slidesPerView: 1, autoplay: { delay: 3000, stopOnLastSlide: false, disableOnInteraction: true, }, pagination: { el: '.swiper-roll-1 .swiper-pagination', clickable: true, }, }); var swiper2 = new Swiper('.swiper-roll-2', { slidesPerView: 1, }); $(".bt-1").click(function () { //swiper2.swipePrev(); swiper2.slidePrev(); }); $(".bt-2").click(function () { //swiper2.swipeNext(); swiper2.slideNext(); }); if ($(".swiper-roll-2").size() > 0) { swiper2.slideTo(1, 0); } $(".tab a").click(function () { $(".tab a").removeClass("active"); $(".tab a:eq(" + $(this).index() + ")").addClass("active"); $(".resources").removeClass("rollactive"); $(".resources:eq(" + $(this).index() + ")").addClass("rollactive"); $("#resroll").addClass("resroll2"); }); if ($("#resroll .resroll").size() > 0) { resroll = new Swiper('#resroll .resroll', { watchSlidesProgress: true, slidesPerView: 'auto', centeredSlides: true, loop: true, loopedSlides: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 9 : 5, autoplay: false, observer: true, observeParents: true, // navigation: { // nextEl: '.pre20', // prevEl: '.next20', // }, pagination: { //el: '.swiper-pagination', //clickable :true, }, on: { slideChangeTransitionEnd: function () { //alert(this.activeLoopIndex); //$(".contr-bt span").text(this.realIndex+1); }, progress: function (progress) { for (i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i); var slideProgress = this.slides[i].progress; modify = 1; if (Math.abs(slideProgress) > 1) { modify = (Math.abs(slideProgress) - 1) * 0.3 + 1; } translate = (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? slideProgress * modify * 110 + 'px' : slideProgress * modify * 80 + 'px'; scale = (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 1 - Math.abs(slideProgress) / 7 : 1 - Math.abs(slideProgress) / 7; 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) > 5) { slide.css('opacity', 0); } } }, setTransition: function (transition) { for (var i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i) slide.transition(transition); } } } }); $("#resroll .arr-l").click(function () { resroll.slidePrev(); }); $("#resroll .arr-r").click(function () { resroll.slideNext(); }); } if ($("#dataroll .resroll").size() > 0) { dataroll = new Swiper('#dataroll .resroll', { watchSlidesProgress: true, slidesPerView: 'auto', centeredSlides: true, loop: true, loopedSlides: 3, autoplay: false, observer: true, observeParents: true, // navigation: { // nextEl: '.pre20', // prevEl: '.next20', // }, pagination: { //el: '.swiper-pagination', //clickable :true, }, on: { slideChangeTransitionEnd: function () { //alert(this.activeLoopIndex); //$(".contr-bt span").text(this.realIndex+1); }, progress: function (progress) { for (i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i); var slideProgress = this.slides[i].progress; modify = 1; if (Math.abs(slideProgress) > 1) { modify = (Math.abs(slideProgress) - 1) * 0.3 + 1; } translate = (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? slideProgress * modify * 150 + 'px' : slideProgress * modify * 100 + 'px'; scale = 1 - Math.abs(slideProgress) / 4; 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) > 1) { slide.css('opacity', 0); } } }, setTransition: function (transition) { for (var i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i) slide.transition(transition); } } } }) }; $("#dataroll .arr-l").click(function () { dataroll.slidePrev() }); $("#dataroll .arr-r").click(function () { dataroll.slideNext() }); })