// 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 () { $('.menubtn').bind('click', function () { $(this).toggleclass('active'); $('.menu-mark').toggleclass('on'); $('.menu-fix').fadetoggle(); }); $(".menu-list li").each(function (index) { $(this).css({ 'animation-delay': (index / 10) + 's' }); }); $('.menu-mark').bind('click', function () { $(this).removeclass('on'); $('.menu-fix').hide(); }); //nav js $(".cfzhead").hover(function(){ $(".cfzhead").addclass("cfzhead-show"); },function(){ var timer=settimeout(function(){ $(".cfzhead").removeclass("cfzhead-show"); },150); }); $(".cfzhead-nav li").hover(function(){ $(".cfzhead").addclass("cfzhead-hide"); $(this).addclass("active"); $(this).find(".subnav").stop(true,true).slidedown(300); }, function(){ $(".cfzhead").removeclass("cfzhead-hide"); $(this).removeclass("active"); $(this).find(".subnav").stop(true,true).slideup(300); }); //banner var ismobile=false, winwidth = 0, winheight = 0, $banner=jquery(".cfzbanner-pc"), $banneritem=jquery(".cfzbanner-pc .item"), $bannerimg=jquery(".cfzbanner-pc .pimg"); function initpro(){ winwidth = jquery(window).width(); winheight = jquery(window).height(); if(!ismobile){ $banner.css({height:winheight}); $banneritem.css({height:winheight}); setimgmax($bannerimg, 1920, 1080, winwidth, winheight); }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('.cfzbanner-pc', { //effect: 'fade', //loop: true, autoplay: { delay: 7000, disableoninteraction: false, }, pagination: { el: '.swiper-pagination', clickable: true, }, }); var swiper = new swiper('.cfzbanner-mobile', { //effect: 'fade', //loop: true, autoplay: { delay: 7000, disableoninteraction: false, }, pagination: { el: '.swiper-pagination', clickable: true, }, }); //业务版图banner var swiper = new swiper('.cluster-banner', { //effect: 'fade', //loop: true, autoplay: { delay: 6000, disableoninteraction: false, }, /* pagination: { el: '.swiper-pagination', clickable: true, },*/ }); var swiper = new swiper('.mobile-cluster-banner', { //effect: 'fade', //loop: true, autoplay: { delay: 6000, disableoninteraction: false, }, /* pagination: { el: '.swiper-pagination', clickable: true, },*/ }); //党风廉建-头条新闻 var swiper = new swiper('.pparty-newsline', { //effect: 'fade', //autoplay: { // delay: 4500, // disableoninteraction: false, // }, pagination: { el: '.swiper-pagination', clickable: true, }, }); //集团要闻 var swiper = new swiper('.pnews-linesider', { //effect: 'fade', autoplay: { delay: 4500, disableoninteraction: false, }, pagination: { el: '.swiper-pagination', clickable: true, }, }); //川商发展基金会 var swiper = new swiper('.poverty-floor-welfare', { effect: 'fade', autoplay: { delay: 4500, disableoninteraction: false, }, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, }); //员工风采 var swiper = new swiper('.pstaff-messagescroll', { //effect: 'fade', autoplay: { delay: 4500, disableoninteraction: false, }, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, }); //精彩瞬间 var swiper = new swiper('.pmoment-list', { navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, }); //最美乡村 var swiper = new swiper('.poverty-rural-leftbig', { direction: 'vertical', autoplay: { delay: 4500, disableoninteraction: false, }, }); var swiper = new swiper('.poverty-rural-leftsmall', { direction: 'vertical', autoplay: { delay: 4500, disableoninteraction: false, }, }); var swiper = new swiper('.poverty-rural-middle', { autoplay: { delay:5000, disableoninteraction: false, }, }); //企业荣誉 var swiper = new swiper('.pabout-honor-list', { //effect: 'fade', //loop: true, autoplay: { delay: 5500, disableoninteraction: false, }, pagination: { el: '.swiper-pagination', clickable: true, }, }); //视频集锦 var swiper = new swiper('.link-video', { //effect: 'fade', //loop: true, //autoplay: { // delay: 5500, // disableoninteraction: false, // }, pagination: { el: '.swiper-pagination', clickable: true, }, }); var section5swiper = new swiper('.pannual-report-sider', { slidesperview: 'auto', //centeredslides: true, spacebetween :96, //initialslide : 1,//默认第二页 autoplay: false, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, breakpoints: { 480: { slidesperview: 2, spacebetween: 10, }, }, }); /**环保产业-重点项目**/ var swiper = new swiper('.key-projects-sider', { slidesperview: 3, spacebetween: 40, slidespergroup: 3, loop: true, //loopfillgroupwithblank: true, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, breakpoints: { 480: { slidesperview: 1, slidespercolumn: 1, spacebetween:15, }, }, }); var swiper = new swiper('.groupslide-news', { slidesperview: 4, slidespercolumn: 2, spacebetween: 30, pagination: { el: '.swiper-pagination', clickable: true, }, breakpoints: { 480: { slidesperview: 2, slidespercolumn: 2, spacebetween: 10, }, }, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, }); //企业集群 var swiper = new swiper('.cluster-partners-list', { //effect: 'fade', //autoplay: { // delay: 4500, // disableoninteraction: false, // }, pagination: { el: '.swiper-pagination', clickable: true, }, }); //发展视界电子杂志tab切换 $(".journal-year a").click(function() { var num = $(this).index(); $(".journal-year a").removeclass("active"); $(this).addclass("active"); $(".journal-page ul").hide().eq(num).fadein() }); $(".pabout-history-year a").click(function() { var num = $(this).index(); $(".pabout-history-year a").removeclass("active"); $(this).addclass("active"); $(".pabout-history-list ul").hide().eq(num).fadein() }); $(".airlines-tab a").click(function() { var num = $(this).index(); $(".airlines-tab a").removeclass("active"); $(this).addclass("active"); $(".airlines-list ul").hide().eq(num).fadein() }); $(".mobile-global-tab a").click(function() { var num = $(this).index(); $(".mobile-global-tab a").removeclass("active"); $(this).addclass("active"); $(".mobile-global-swith .s-item").hide().eq(num).fadein() }); //全球布局 $(".global-layout-tab a").click(function() { var num = $(this).index(); $(".global-layout-tab a").removeclass("active"); $(this).addclass("active"); if(num === 0){ $('.tooltip-world').show(); $('.tooltip-china').hide(); }else{ $('.tooltip-world').hide(); $('.tooltip-china').show(); } $(".global-layout-swith").hide().eq(num).fadein(); }); //加载动画 $(".pparty-newslist li, .publication-column li, .pleader-list li, .pvoice-list li, .pweekly-list li, .cfzcolumn a, .pculture-mind li, .pculture-pioneer li, .precruit-list li, .pabout-history-year a, .pconcept-guideword dl, .cluster-capital-prise li, .ptalent-zhaop-list li, .ptalent-kaohe-list li, .ptalent-peiy li").each(function(i, e) { $(this).attr("data-wow-delay", +(i * 100) + "ms"); }); //滚动条 $(".scroll").mcustomscrollbar({ mousewheel: { preventdefault: true, deltafactor: 300 } }); });