// 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 } }); });