// javascript document function setimgmax(img, imgw, imgh, tw, th) { //设置图片宽高比例 var twidth = tw || win_width; var theight = th || win_height; var coe = imgh / imgw; var coe2 = theight / twidth; if (coe < coe2) { var imgwidth = theight / coe; img.css({ height: theight, width: imgwidth, left: -(imgwidth - twidth) / 2, top: 0 }); } else { var imgheight = twidth * coe; img.css({ height: imgheight, width: twidth, left: 0, top: -(imgheight - theight) / 2 }); } } $(function () { //banner /*var ismobile=false, winwidth = 0, winheight = 0, $banner=jquery(".addbanner"), $banneritem=jquery(".addbanner .item"), $bannerimg=jquery(".addbanner .pimg"); function initpro(){ winwidth = jquery(window).width(); winheight = jquery(window).height(); if(!ismobile){ $banner.css({height:winheight - 82}); $banneritem.css({height:winheight - 82}); setimgmax($bannerimg, 1920, 856, winwidth, winheight - 82); }else{ $banner.css({height:"auto"}); $banneritem.css({height:"auto"}); $bannerimg.attr("style","").css({position: "relative"}); } } initpro(); jquery(window).resize(function () { initpro(); });*/ var swiper = new swiper('.addbanner', { //effect: 'fade', //loop: true, autoplay: { delay: 5500, disableoninteraction: false, }, pagination: { el: '.swiper-pagination', clickable: true, renderbullet: function (index, classname) { return '' + (index + 1) + ''; }, }, }); //企业荣誉 var swiper = new swiper('.phonor-year', { slidesperview: 10, spacebetween: 50, // init: false, observer:true,//修改swiper自己或子元素时,自动初始化swiper observeparents:true,//修改swiper的父元素时,自动初始化swiper pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, breakpoints: { 480: { slidesperview: 3, spacebetween: 15, }, 1440: { slidesperview: 7, spacebetween: 40, }, } }); var swiper = new swiper('.phonor-list', { watchslidesprogress: true, slidesperview: 'auto', centeredslides: true, loop: true, loopedslides: 5, //autoplay: true, observer:true,//修改swiper自己或子元素时,自动初始化swiper observeparents:true,//修改swiper的父元素时,自动初始化swiper navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, breakpoints: { 480: { slidesperview: 1, spacebetween: 0, }, }, 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 * 145 + 'px'; scale = 1 - math.abs(slideprogress) / 5; 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 swiper = new swiper('.pmemorab-list', { direction: 'vertical', slidesperview: 7, spacebetween:0, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, }); //网站地图 $(".nzhead-menubtn").on('click',function() { $('.menufigure').addclass('on'); $('.menuitem').addclass('on'); settimeout(function(){ $('.menuitem-title').addclass('on'); },600); settimeout(function(){ $('.menuitem-list').addclass('on'); },800); settimeout(function(){ $('.menuitem-footer').addclass('on'); },1000); }) $(".menuitem-close").on('click',function() { $('.menufigure').removeclass('on'); $('.menuitem-title').removeclass('on'); $('.menuitem-list').removeclass('on'); $('.menuitem-footer').removeclass('on'); $('.menuitem').removeclass('on'); }) //业务板块tab切换 $(".nzbusiness-tab li").hover(function() { var num = $(this).index(); $(".nzbusiness-tab li").removeclass("active"); $(this).addclass("active"); $(".nzbusiness-word .w-item").hide().eq(num).show() }); //班子团队弹窗 $(".pabout-team li .posit dl dd a").click(function () { $(".pteam-marsk").show(); $(".pteam-pup").show(); $('html').css({"overflow-y":"hidden"}); }); //关闭弹窗 $(".pteam-pup .close, .pteam-marsk").click(function () { $(".pteam-marsk").hide(); $(".pteam-pup").hide(); $('html').css({"overflow-y":"auto"}); }); //搜索 $(".srhbtn").mouseenter(function () { $(".srhbox").show(); }); $(".srhbox").mouseleave(function () { $(this).hide(); }); //企业荣誉tab切换 $(".phonor-year li").click(function() { var num = $(this).index(); $(".phonor-year li").removeclass("swiper-slide-active"); $(this).addclass("swiper-slide-active"); $(".phonor-listbox").hide().eq(num).show() }); }); //顶部固定 var a=0; function e() { var e = $(window).scrolltop(); e > a ? $(".nzhead").addclass("topfix") : $(".nzhead").removeclass("topfix"); } $(window).scroll(e), e() //返回顶部 $(function(){ $('.js-gotop').on('click', function(){ $('body, html').stop().animate({scrolltop: 0}, 400 + $(window).scrolltop() * 0.3); }); });