(function () { setTimeout(function(){ $("body").addClass("show") },500); //澶撮儴鎼滅储 var seachBox = $('.search_box'), seachBtn = $('.seach_btn'), searchClose = $('.search_close'); seachBtn.click(function (event) { seachBox.addClass('show'); }); searchClose.click(function (event) { seachBox.removeClass('show'); }); $("#navList>li").hover(function(){ $("#navList>li").addClass("noActive"); $(this).removeClass("noActive"); },function(){ $("#navList>li").removeClass("noActive"); }) //鏄剧ず瀵艰埅 function showMenu() { var _body = $('body'), _navList = $('#navList'), _itemList = _navList.find('>li'), _smMenu = $('#smMenu'), _fixed = 'fixed', _subItem = '.sub-item', _handle = 'span.top', _show = 'showIt'; _itemList.each(function () { if ('undefined' !== typeof $(this).find(_subItem).get(0)) { $(this).find(_handle).on('click', function () { var _parent = $(this).parents('li').eq(0); if (_parent.hasClass(_show)) { _parent.removeClass(_show); } else { $(this).parents('ul').find('li').removeClass(_show); _parent.addClass(_show); } }); } else { $(this).find(_handle).addClass('empty'); } }); //鏄剧ず瀵艰埅 _smMenu.on('click', function () { if (_body.hasClass(_fixed)) { _body.removeClass(_fixed); } else { _body.addClass(_fixed); } }); } //pc椤堕儴瀵艰埅鍥哄畾 function fixedNav() { var _body = $('body'), _fixed = 'fixed2', _isInner = false, _top = 0, _limit = 38; function isFixed(_top) { if (_top > _limit && !_body.hasClass(_fixed)) { _body.addClass(_fixed); } else if (_top <= _limit && _body.hasClass(_fixed)) { _body.removeClass(_fixed); } } isFixed($(window).scrollTop()); $(window).scroll(function () { if (!_isInner) { _isInner = true; _top = $(this).scrollTop(); if (_isInner) isFixed(_top); _isInner = false; } }); } $(function () { showMenu(); fixedNav(); }); })(jQuery); function indexBannerSize(){ var bannerImgObj = $(".imgN>img"); //鍥剧墖瀵硅薄 var winWidth = $(window).width(); //娴忚鍣ㄥ搴 var winHeight = $(window).height(); //娴忚鍣ㄩ珮搴 if(1024 < $(window).width()){ bannerImgObj = $(".imgY>img"); //鍥剧墖瀵硅薄 } $('.i_banner').height(winHeight); $('.i_banner .img').width(winWidth); $('.i_banner .img').height(winHeight); $(".i_banner .ibanner_box .iteam .img").css("transition", "all 10s ease"); bannerImgObj.each(function(){ var _this = $(this); //_this.css({"width":"100%","left":"50%"}); _this.css({"width":"100%"}); getImageSize(_this.attr("src"),function(w,h){ var ratio = w/h; //鍥剧墖姣斾緥 var showH = winWidth/ratio; //鍥剧墖鏄剧ず楂樺害 var newW; //鏂拌缃殑鍥剧墖瀹藉害 if(showH < winHeight){ //鍥剧墖鏄剧ず楂樺害灏忎簬绐楀彛楂樺害 newW = winHeight*ratio; _this.css({"height":"100%","width":newW}); }else{ newW = winWidth; _this.css({"width":"100%","height":"auto"}); } //_this.css({"margin-left":"-"+newW/2+"px"}); }) }); } //鑾峰彇鍥剧墖灏哄 function getImageSize(url,callback){ var img = new Image(); img.src = url; // 濡傛灉鍥剧墖琚紦瀛橈紝鍒欑洿鎺ヨ繑鍥炵紦瀛樻暟鎹 if(img.compvare){ callback(img.width, img.height); }else{ // 瀹屽叏鍔犺浇瀹屾瘯鐨勪簨浠 img.onload = function(){ callback(img.width, img.height); } } } // bannerResize = function () { // try { // $(".i_banner .ibanner_box .iteam .img").css("transition", "all 0s ease"); // // 棣栭〉banner(鍥剧墖姣斾緥1920*800) // var winH = $(window).outerHeight(); // var winW = $(window).outerWidth(); // $('.i_banner').height(winH); // $('.i_banner .img').width(winW); // $('.i_banner .img').height(winH); // $('.i_banner .video_box').width(winW); // $('.i_banner .video_box').height(winH); // $(".i_banner .ibanner_box .iteam .img").css("transition", "all 10s ease"); // banner.updateSize(); // //alert(); // } catch (error) { // } // } $(".index_business_more .hidden").eq(2).find(".swiper-slide").eq(0).find(".pc_box").find(".item").eq(0).find(".img").css({"background-position":"right center" }); $(function(){ // bannerResize(); indexBannerSize(); $(".ibanner-nums").text($(".ibanner_box").find(".swiper-slide").length); var banner = new Swiper('.ibanner_box', { slidesPerView: 1, paginationClickable: true, spaceBetween: 0, loop: true, autoplay: { delay: 3000, stopOnLastSlide: false, disableOnInteraction: false, }, pagination: { el: '.ibanner-pagination', clickable: true, }, on:{ init: function(swiper){ $(".ibanner-num").text(this.activeIndex + 1); $(".ibanner-fix").addClass("active"); this.emit('transitionEnd'); }, slideChange: function(){ $(".ibanner-num").text(this.realIndex + 1); return false; }, slideChangeTransitionStart: function(){ $(".ibanner-fix").removeClass("active"); }, slideChangeTransitionEnd: function(){ $(".ibanner-fix").addClass("active"); }, }, observer: true, }); }) //澶撮儴婊氬姩 $(document).ready(function () { $(window).scroll(function () { currTop = $(window).scrollTop(); if (currTop < 20) { $('.header-wrapper').removeClass('tophide'); } else { $('.header-wrapper').addClass('tophide'); } if (currTop > 0) { $("body").removeClass("fixed"); } }); if ($(window).scrollTop() > 0) { $('.header-wrapper').addClass('tophide'); } $(".index_check .iteam ").eq(0).addClass("active"); $(".index_check .iteam ").hover(function () { $(".index_check .iteam").removeClass("active"); $(this).addClass("active"); }) }) // 渚у鑸 var swipernotice = new Swiper('.notice-container', { direction: 'vertical', loop: true, autoplay: { delay: 3000, stopOnLastSlide: false, disableOnInteraction: true, }, navigation: { nextEl: '.notice-next', prevEl: '.notice-pre', }, }); var swiper1; var swiper2; var swiper3; $(function () { try { $(window).on('resize', function () { repage_com(); indexBannerSize(); }); repage_com(); } catch (error) { } function repage_com() { pagew = $(document).outerWidth(true) + (window.innerWidth - document.body.clientWidth); pageh = $(window).innerHeight(); try { $(".curdiv_h").each(function () { $(this).css({ "height": ($(this).attr("data-h") * $(this).width() / $(this).attr("data-w")) + "px" }); }); } catch (e) { } } }) $(function(){ $(".backTop").click(function(){ $('html,body').animate({ scrollTop: 0 }, 700); }) var newLocal = ".category_head"; $(newLocal).click(function(){ $(".page_nav").slideToggle(300); $(".category_head").toggleClass("active"); }) var videoBor = $(".about_info_fr");//video鐨剆wiper瀵硅薄鏁扮粍 var videolist = videoBor.find("video");//video瀵硅薄鏁扮粍 videoBor.on("click",function(){ var $video = $(this).find("video")[0]; if($video.paused){ var videoPoster =$(this).find(".posterBg");//褰撳墠灏侀潰瀵硅薄 videoPoster.hide(); $video.play(); }else{ $video.pause(); } }); videolist.on("pause",function(){ /*鎵€鏈夊皝闈㈡诞灞俿how&鎵€鏈夎棰慼ide*/ videoBor.find(".posterBg").show(); videoBor.find("video").hide(); }); videolist.on("play",function(){ /*褰撳墠瑙嗛show*/ $(this).show(); }); }) /** * honor * * */ var honorSwipers function honorSwiper(){ if(1024 < $(window).width()){ if($(".honor_container").find(".swiper-slide").length < 5){ $(".honor_container").find(".swiper-wrapper").append($(".honor_container").find(".swiper-wrapper").html()); if($(".honor_container").find(".swiper-slide").length < 5){ $(".honor_container").find(".swiper-wrapper").append($(".honor_container").find(".swiper-wrapper").html()); } } /*** * * 1240 / 1920 = 0.645 绠楀嚭瀹藉害鍗犱緥 * honorW / 0.646 寰楀嚭瀹藉害杞挱鍥惧搴 * * * */ var honorW = $(".honor_body").width(); $(".honor_container").css("margin-left",- ((1920 - honorW) / 2)); honorSwipers = new Swiper('.honor_container',{ slidesPerView: 3, loop:true, centeredSlides : true, autoplay:3000, // Enable 3D Flow tdFlow: { rotate : 0, stretch :1350, depth: 850, modifier : 0.3, shadows:false } }) }else{ honorSwipers = new Swiper('.honor_container',{ slidesPerView: 1, loop:true, centeredSlides : true, autoplay:3000, }) } $('.honor-button-prev').on('click', function(e){ e.preventDefault() honorSwipers.swipePrev() }) $('.honor-button-next').on('click', function(e){ e.preventDefault() honorSwipers.swipeNext() }) } $(function(){ $('.friend-links li').on('touchstart',function(e){ var c = $(this).find('.friend-links-childs') if($.contains(c[0],e.target) || e.target === c){ return } $(this).toggleClass( "active" ); }) $(window).on('resize', function () { try { honorSwiper(); honorSwipers.reInit(); } catch (error) { } }); honorSwiper(); }) $(function(){ if($(".energy-relevant-container").find(".swiper-slide").length < 2) { $(".relevant-pagination").hide(); }; }) if(1024 < $(window).width()){ var swiperRelevant = new Swiper('.energy-relevant-container', { slidesPerView: 1, spaceBetween: 1000, paginationClickable: true, pagination: { el: '.relevant-pagination', clickable: true, }, observer: true,//淇敼swiper鑷繁鎴栧瓙鍏冪礌鏃讹紝鑷姩鍒濆鍖杝wiper observeParents: true,//淇敼swiper鐨勭埗鍏冪礌鏃讹紝鑷姩鍒濆鍖杝wiper }); }else{ var swiperRelevant = new Swiper('.energy-relevant-container', { slidesPerView: 1, spaceBetween: 100, paginationClickable: true, pagination: { el: '.relevant-pagination', clickable: true, }, observer: true,//淇敼swiper鑷繁鎴栧瓙鍏冪礌鏃讹紝鑷姩鍒濆鍖杝wiper observeParents: true,//淇敼swiper鐨勭埗鍏冪礌鏃讹紝鑷姩鍒濆鍖杝wiper }); } /// 闆嗗洟 var galleryThumbs = new Swiper('.news-container-bottom', { spaceBetween: 20, slidesPerView: 5, freeMode: true, watchSlidesVisibility: true, watchSlidesProgress: true, }); var galleryTop = new Swiper('.news-container-top', { slidesPerView: 1, spaceBetween: 20, navigation: { nextEl: '.news-button-next', prevEl: '.news-button-prev', }, loop: true, autoplay: { delay: 6000, disableOnInteraction: false, }, speed: 600, thumbs: { swiper: galleryThumbs } }); /// 闆嗗洟鏂伴椈璇︽儏 鎺ㄨ崘 if(1024 < $(window).width()){ var swiperRecommend = new Swiper('.recommend-container', { slidesPerView: 3, spaceBetween: 32.5, paginationClickable: true, pagination: { el: '.recommend-pagination', clickable: true, }, observer: true,//淇敼swiper鑷繁鎴栧瓙鍏冪礌鏃讹紝鑷姩鍒濆鍖杝wiper observeParents: true,//淇敼swiper鐨勭埗鍏冪礌鏃讹紝鑷姩鍒濆鍖杝wiper }); }else{ var swiperRecommend = new Swiper('.recommend-container', { slidesPerView: 1, spaceBetween: 32.5, paginationClickable: true, pagination: { el: '.recommend-pagination', clickable: true, }, observer: true,//淇敼swiper鑷繁鎴栧瓙鍏冪礌鏃讹紝鑷姩鍒濆鍖杝wiper observeParents: true,//淇敼swiper鐨勭埗鍏冪礌鏃讹紝鑷姩鍒濆鍖杝wiper }); } // var pageSwiperBuilding = new Swiper('.page-building-container', { // slidesPerView: 1, // paginationClickable: true, // spaceBetween: 50, // autoplay: { // delay: 6000, // stopOnLastSlide: false, // disableOnInteraction: true, // }, // pagination: { // el: '.building-pagination', // clickable: true, // } // }); var pageSwiperBuilding = new Swiper('.page-building-container', { slidesPerView: 1, paginationClickable: true, autoplay : 5000, pagination : '.building-pagination', });