var Lplug={ Init:function(e){ var that=this; that.setLoading(); that.setNavToggle(); $(".lazy").lazyload({ //placeholder : "/style/img/loading.png", //effect: "fadeIn", threshold:$(window).height()/2 }); that.Banners(); that.closeLayer(); new WOW({ offset:200 }).init(); new Rellax('.rellax'); smoothScroll.init({offset:100}); that.setAccordion(); that.scrolls(); //that.cursorFollow(); //rippleEffect($('.lh-ban')[0]); //that.waterAn(); that.Tab(); that.indexAn(); that.setStar(); }, //棣栭〉鏁堟灉 indexAn:function(){ if($('.sector-item').length>0){ var _length=$('.sector-item li').length; var _rotate=360/_length; $('.sector-item li').each(function(i,v){ $(v).css({transform:'rotate('+_rotate*i+'deg)'}); $(v).children().css({transform:'rotate('+-(_rotate*i)+'deg)'}); }); } $('.lh-nav>*').hover(function(){ if($(this).children('dl').length>0) $('header').addClass('White'); },function(){ $('header').removeClass('White'); }); }, //瀵艰埅灞曞紑/鏀惰捣 setNavToggle:function(){ $('.nav-btn').click(()=>{ $('body').hasClass('NavToggle')?$('body').removeClass('NavToggle'):$('body').addClass('NavToggle'); }); $('.toggle-shadow').click(()=>{ $('body').removeClass('NavToggle'); }); }, //鍔犺浇鍔ㄧ敾 setLoading:function(){ if(performance.navigation.type==1){ localStorage.removeItem("first"); } var isfirst=localStorage.getItem("first"); if(!isfirst){ localStorage.setItem("first",true); $('body').addClass('showLoading'); } }, //姘存尝绾瑰姩鐢 waterAn:function(){ var img = document.querySelector("#displacementFilter feTurbulence"); if(img){ var frames = 0; var rad = Math.PI / 180; function AnimateBaseFrequency() { var bf = "0.01 .1"; bfx = Number(bf.split(" ")[0]); bfy = Number(bf.split(" ")[1]); frames += .5 bfx += 0.001 * Math.cos(frames * rad); bfy += 0.005 * Math.sin(frames * rad); bf = bfx.toString() + ' ' + bfy.toString(); img.setAttributeNS(null, 'baseFrequency', bf); requestAnimationFrame(AnimateBaseFrequency); } window.requestAnimationFrame(AnimateBaseFrequency); } }, //鎵嬮鐞 setAccordion:function(){ $('.lhAccordion>*').eq(0).addClass('on'); $('.lhAccordion .hd').click(function(){ if($(this).parent().hasClass('on')){ $(this).parent().removeClass('on'); }else{ $(this).parent().addClass('on'); $(this).parent().siblings().removeClass('on'); } }); }, //娴忚鍣ㄧ獥鍙e搴 winInfo:function(){ var width = $(window).width(); var height = $(window).height(); return {_winW:width,_winH:height}; }, //ie9娴忚鍣 isLetIe9:function(){ return navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion.split(";")[1].replace(/[ ]/g, "").replace("MSIE",""))<=9; }, //ie8娴忚鍣 isLetIe8:function(){ return navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion.split(";")[1].replace(/[ ]/g, "").replace("MSIE",""))<=8; }, setIe9:function(){ var that=this; }, //ie8娴忚鍣ㄨ皟鐢ㄧ殑js setIe8:function(){ var that=this; $('.ie8Fullscreen').height(this.winInfo()._winH); }, setBanner:function(a){ var a=a||{}; var opt = $.extend({ boxCell:'.lh-banner', paginationEl:'.hd', paginationType:'bullets', paginationBulletElement:'li', paginationDynamicBullets:false, paginationDynamicMainBullets:1, paginationClickable:true, paginationRenderBullet:null, paginationBulletActiveClass:'on', stopOnLastSlide:true, slidesPerView:1, spaceBetween:0, speed:750, loop:false, direction:'horizontal', initialSlide:0, effect:'fade', mousewheel:false, nextEl:'.next', prevEl:'.prev', noSwipingClass:'stop-swiping', on:null, observer:true, observeParents:true, observeSlideChildren:true, parallax:true, disableOnInteraction:false, mainCell:'.swiper-wrapper', autoPage:true, autoPlay:false, delay:4500, stopOnLastSlide:false, disableOnInteraction:true, hashNavigation:false, slidesPerColumn:1, grabCursor:false, loopedSlides:1, freeMode:false, nested:false, scrollbar:'.swiper-scrollbar', hover:"true", centeredSlides:false, releaseOnEdges:false, draggable:false, eventsTarged:'.i', },a); if($(opt.boxCell).find('.next').length>0){ var nextEl = $(opt.boxCell).find('.next'),prevEl = $(opt.boxCell).find('.prev'); }else{ var nextEl =opt.nextEl,prevEl =opt.prevEl; } if(opt.autoPlay){ var autoPlay ={ delay:opt.delay, stopOnLastSlide:opt.stopOnLastSlide, disableOnInteraction:opt.disableOnInteraction } }else{ var autoPlay=false; } var _mousewheel=false; if(opt.mousewheel){ _mousewheel={eventsTarged:opt.eventsTarged}; if(opt.releaseOnEdges){ _mousewheel['releaseOnEdges']=opt.releaseOnEdges; } } var mySwiper = new Swiper(opt.boxCell,{ parallax : opt.parallax, slidesPerView:opt.slidesPerView, initialSlide :opt.initialSlide, pagination : { el : opt.paginationEl, type:opt.paginationType, bulletElement:opt.paginationBulletElement, dynamicBullets:opt.paginationDynamicBullets, dynamicMainBullets:opt.paginationDynamicMainBullets, clickable:opt.paginationClickable, renderBullet:opt.paginationRenderBullet, bulletActiveClass:opt.paginationBulletActiveClass }, speed:opt.speed, loop:opt.loop, effect : opt.effect, spaceBetween:opt.spaceBetween, navigation: { nextEl: nextEl, prevEl: prevEl, }, direction:opt.direction, mousewheel:_mousewheel, noSwipingClass:opt.noSwipingClass, on:opt.on, observeParents:opt.observeParents, observer:opt.observer, autoplay:autoPlay, stopOnLastSlide:opt.stopOnLastSlide, disableOnInteraction:opt.disableOnInteraction, hashNavigation:opt.hashNavigation, slidesPerColumn:opt.slidesPerColumn, grabCursor:opt.grabCursor, //loopedSlides:opt.loopedSlides, freeMode:opt.freeMode, nested:opt.nested, scrollbar:{ el:opt.scrollbar, draggable:opt.draggable }, lazy: { loadPrevNext: true, }, observeSlideChildren:opt.observeSlideChildren, centeredSlides:opt.centeredSlides }); if(autoPlay&&opt.hover=="true"){ let nextTransForm='', nexTime=0; mySwiper.el.onmouseover = function(){ //瀹炵幇鏃犵紳婊氬姩鍒囨崲鏁堟灉 if(opt.delay=='1'){ nextTransForm=mySwiper.$wrapperEl[0].style.transform; // 杞挱鍥惧師鏈簲绉诲姩鍒扮殑浣嶇疆 let nextTransPosition =-1 * parseInt( mySwiper.$wrapperEl[0].style.transform.split("translate3d(")[1].split("px")[0] ); // 榧犳爣鎮诞鏃舵椂杞挱鍥句綅缃 let nowTransPosition =-1 *parseInt( window.getComputedStyle(mySwiper.$wrapperEl[0],false)["transform"].split("1, ")[2].split(",")[0] ) // 瀛樻斁榧犳爣鎮诞鏃惰疆鎾浘鐨勭湡瀹瀟ransform灞炴€э紙闈炶鍐呭睘鎬э級 let nowTransForm = window.getComputedStyle(mySwiper.$wrapperEl[0],false )["transform"]; // 璁$畻杞挱鍥句粠鏆傚仠浣嶇疆绉诲姩鍒板師鏈簲鍒扮殑浣嶇疆鎵€鐢ㄧ殑鏃堕棿锛?70鏄垜鑷畾涔夌殑姣忎釜slide鐨勫搴︼級 nextTime = 3000 * ((nextTransPosition - nowTransPosition) / 250); mySwiper.$wrapperEl[0].style.transform = nowTransForm; mySwiper.$wrapperEl[0].style.transitionDuration = "0ms"; } mySwiper.autoplay.stop(); } mySwiper.el.onmouseout = function(){ if(opt.delay=='1'){ mySwiper.$wrapperEl[0].style.transform = nextTransForm; mySwiper.$wrapperEl[0].style.transitionDuration = nextTime+"ms"; } mySwiper.autoplay.start(); } /*$(opt.boxCell).mouseenter(function () { console.log('stop'); console.log(mySwiper); mySwiper.autoplay.stop(); }) $(opt.boxCell).mouseleave(function () { console.log('start'); mySwiper.autoplay.start(); })*/ } return mySwiper; }, //banners Banners:function(e){ var that=this; var _swiperJson={}; that.bannerBefore(); $('.lh-public-banner').each(function() { var boxCell = '.'+$(this)[0].className.split(' ')[0],slidesPerView=$(this).attr('data-slidesPerView'),autoplay=$(this).attr('data-autoplay'),delay=Number($(this).attr('data-delay'))||4500,webslidesPerView=$(this).attr('data-webslidesPerView')||1,length = $(this).find('.bd .swiper-slide').length,paginationEl='',slidesPerColumn=$(this).attr('data-slidesPerColumn'),loop=$(this).attr('data-loop'),loopedSlides=$(this).attr('data-loopedSlides'),prev='.prev',next='.next',direction=$(this).attr('data-direction')||'horizontal',noSwipingClass=$(this).attr('data-noSwipingClass')||'stop-swiping',effect=$(this).attr('data-effect')||'slide',hover=$(this).attr('data-hover')||"true",paginationType=$(this).attr('data-paginationType')||'bullets',centeredSlides=$(this).attr('data-centeredSlides'),mousewheel=$(this).attr('data-mousewheel')||false,speed=Number($(this).attr('data-speed'))||750,hashNavigation=$(this).attr('data-hashNavigation')||false,freeMode=$(this).attr('data-freeMode')||false,draggable=$(this).attr('data-draggable')||false,eventsTarged=$(this).attr('data-eventsTarged')||'.index-content',releaseOnEdges=$(this).attr('data-releaseOnEdges')||false,paginationRenderBullet=null,initialSlide=Number($(this).attr('data-initialSlide'))||0; if($(this).find('.bannerhd').length>0){ paginationEl = '.'+$(this).find('.bannerhd')[0].className.split(' ')[0]; }else if($(this).parents('.bannerBox').find('.bannerhd').length>0){ paginationEl = '.'+$(this).parents('.bannerBox').find('.bannerhd')[0].className.split(' ')[0]; } if(!slidesPerView){ slidesPerView=1; } if(!slidesPerColumn){ slidesPerColumn=1; } if(!autoplay){ autoplay=0; } if(!delay){ delay=4500; } if(!loop){ loop=false; } if(speed<50){ speed=0; } if(!loopedSlides){ loopedSlides=1; } if(that.winInfo()._winW<=980){ if(slidesPerView){ slidesPerView = webslidesPerView; } noSwipingClass='stop-swiping'; if(direction=='vertical'&&boxCell=='.course-banner'){ direction='horizontal'; } } if(mousewheel){ mousewheel=true; } if(hashNavigation)hashNavigation=true; if(freeMode)freeMode=true; if(draggable)draggable=true; if(releaseOnEdges)releaseOnEdges=true; if($(this).find('.bannerBtn').length>0){ if($(this).find('.bannerBtn .prevs').length>0)var prev = '.'+$(this).find('.bannerBtn .prevs')[0].className.split(' ')[0]; if($(this).find('.bannerBtn .nexts').length>0)var next = '.'+$(this).find('.bannerBtn .nexts')[0].className.split(' ')[0]; $(this).find('.bannerBtn').hide(); } if($(this).parents('.bannerBox').find('.bannerBtn').length>0){ if($(this).parents('.bannerBox').find('.bannerBtn .prevs').length>0)var prev = '.'+$(this).parents('.bannerBox').find('.bannerBtn .prevs')[0].className.split(' ')[0]; if($(this).parents('.bannerBox').find('.bannerBtn .nexts').length>0)var next = '.'+$(this).parents('.bannerBox').find('.bannerBtn .nexts')[0].className.split(' ')[0]; $(this).parents('.bannerBox').find('.bannerBtn').hide(); } if(length>slidesPerView || (slidesPerView=='auto'&&length>1)){ var a = that.setBanner({boxCell:boxCell,paginationEl:paginationEl,effect:effect,slidesPerView:slidesPerView,autoPlay:autoplay,delay:delay,slidesPerColumn:slidesPerColumn,prevEl:prev,nextEl:next,loop:loop,loopedSlides:loopedSlides,direction:direction,hover:hover,noSwipingClass:noSwipingClass,paginationType:paginationType,centeredSlides:centeredSlides,mousewheel:mousewheel,speed:speed,hashNavigation:hashNavigation,freeMode:freeMode,draggable:draggable,eventsTarged:eventsTarged,releaseOnEdges:releaseOnEdges,paginationRenderBullet:paginationRenderBullet,initialSlide:initialSlide,on:{ transitionStart:function(){ var _index=this.realIndex+1; if(boxCell=='.lh-banner'){ if(_index<9){ _index='0'+_index; } $('.banner-num span').text(_index); }else if(boxCell=='.concept-banner'){ if(_swiperJson['.concept-r'])_swiperJson['.concept-r'].slideTo(_index-1); }else if(boxCell=='.culture-banner'){ $('.culture-hd>*').eq(_index-1).addClass('on').siblings().removeClass('on'); }else if(boxCell=='.enterprise-banner'){ if(_index<9){ _index='0'+_index; } $('.enterprise-num .current').text(_index); $('.enterprise-circle>*').each(function(i,v){ var _x=that.randomNum(100,$(window).width()/3), _y=that.randomNum(100,$('.about-enterprise').height()), _scale=that.randomNum(2,10)*0.1; TweenMax.to(v, 1, {x:_x,y:_y,scale:_scale}); }); }else if(boxCell=='.video-banner'){ $(this.slides).each(function(i,v){ if($(v).find('video').length>0){ $(v).find('video')[0].pause(); } }); $('.video-hd li').eq(_index-1).addClass('on').siblings().removeClass('on'); if(_swiperJson['.video-hd'])_swiperJson['.video-hd'].slideTo(_index-3); }else if(boxCell=='.projectDetail-banner'){ if(_index<9){ _index='0'+_index; } $('.projectDetail-btn .current').text(_index); }else if(boxCell=='.regional-top'){ $('.regional-banner .bd li').eq(_index-1).addClass('on').siblings().removeClass('on'); if(_swiperJson['.regional-banner'])_swiperJson['.regional-banner'].slideTo(_index-2); } }, }}); _swiperJson[boxCell]=a; if($(this).find('.bannerBtn').length>0){ $(this).find('.bannerBtn').show(); } if($(this).find('.lh-banner-hd').length>0){ $(this).find('.lh-banner-hd').show(); } if($(this).parents('.bannerBox').find('.bannerBtn').length>0){ $(this).parents('.bannerBox').find('.bannerBtn').show(); } }else{ $(boxCell).find('.swiper-lazy').each(function(){ if($(this).is("img")){ var original=$(this).data('src'); $(this).attr("src",original); }else{ var original=$(this).data('background'); $(this).css("background-image", "url('" + original + "')"); } if($(this).next('.swiper-lazy-preloader').length>0){ $(this).next('.swiper-lazy-preloader').remove(); } }); } }); that.bannerAfter(_swiperJson); }, bannerBefore:function(e){ let that=this; //浼佷笟鍒婄墿 if($('.enterprise-num .total').length>0){ var _length=$('.enterprise-banner .bd>*').length; if(_length<=9){ _length='0'+_length; } $('.enterprise-num .total').text(_length); $('.enterprise-circle>*').each(function(i,v){ var _x=that.randomNum(100,$(window).width()/3), _y=that.randomNum(100,$('.about-enterprise').height()), _scale=that.randomNum(2,10)*0.1; TweenMax.to(v, 1, {x:_x,y:_y,scale:_scale}); }); } //椤圭洰璇︽儏 if($('.projectDetail-banner').length>0){ var _length=$('.projectDetail-banner .bd>*').length; if(_length<=9){ _length='0'+_length; } $('.projectDetail-btn .total').text(_length); } //鍙戝睍鍘嗙▼ if($('.course-item').length>0){ $('.course-item>*').eq(0).addClass('on'); var _text=$('.course-item>*').find('.text').html(); $('.course-text').html(_text); $('.course-item>*').hover(function(){ $(this).addClass('on').siblings().removeClass('on'); var _text=$(this).find('.text').html(); $('.course-text').html(_text); }); } }, bannerAfter:function(_swiperJson){ let that=this; //浼佷笟鏂囧寲鏉垮潡 $('.culture-hd>*').eq(0).addClass('on'); $('.culture-hd>*').click(function(){ var _index=$(this).index(); if(_swiperJson['.culture-banner'])_swiperJson['.culture-banner'].slideTo(_index); }); //鍔ㄦ€佽棰 var _idx=2; if(that.winInfo()._winW<=980){ _idx=1; } $('.video-hd li').eq(_idx).addClass('on'); $('.video-hd li').click(function(){ var _index=$(this).index(); if(_swiperJson['.video-banner'])_swiperJson['.video-banner'].slideTo(_index); }); //鍖哄煙鏍囨潌椤圭洰 if($('.regional-banner').length>0){ $('.regional-banner .bd li').eq(0).addClass('on'); $('.regional-banner .bd li').click(function(){ var _index=$(this).index(); if(_swiperJson['.regional-top'])_swiperJson['.regional-top'].slideTo(_index); return false; }); } }, //tab Tab:function(e){ $('.lhTab').each(function(){ var _this=$(this); var boxCell = '.'+$(this)[0].className.split(' ')[0]; var hdLength=$(boxCell).find('.tab-hd>*.on').length; if(hdLength>0){ $(boxCell).find('.tab-hd>*').each(function(i,v){ if($(v).hasClass('on')){ $(boxCell).find('.tab-bd>*').eq(i).addClass('on').siblings().removeClass('on'); } }); }else{ $(boxCell).find('.tab-hd>*').eq(0).addClass('on'); $(boxCell).find('.tab-bd>*').eq(0).addClass('on').siblings().removeClass('on'); } if($(boxCell).data('type')){ _this.find('.tab-hd>*').hover(function(){ /*var _href=$(this).children('a').attr('href'); if(_href !='javascript:;' && _href){ return; }*/ tabShow(this,boxCell); }); }else{ _this.find('.tab-hd>*').click(function(){ tabShow(this,boxCell) }); } }); function tabShow(_that,boxCell){ var _index=$(_that).index(); $(_that).addClass('on').siblings().removeClass('on'); $(_that).parents(boxCell).find('.tab-bd>*').eq(_index).addClass('on').siblings().removeClass('on'); var _wow=$(_that).parents(boxCell).find('.tab-bd>*').eq(_index).find('.wow'); if(_wow.length>0){ _wow.each(function(i,v){ var _wowArray=$(v)[0].className.split(' '); for(var i=0;i<_wowArray.length;i++){ if(_wowArray[i]=='wow'){ if(_wowArray[i+1]){ $(v).attr({style:'visibility: visible; animation-name: '+_wowArray[i+1]+';'}); }else{ $(v).attr({style:'visibility: visible; animation-name: none;'}); } } } }); } } }, //婊氬姩瑙嗚宸 scrollVisual:function(e){ var that=this,winH=that.winInfo()._winH,winW=that.winInfo()._winW,e=e||window; $(e).scroll(function(){ scrollAn(); }); scrollAn(); function scrollAn(){ $('[data-visual]').each(function(){ //speed 閫熷害(0.1);type 鑳屾櫙鍥剧墖杩樻槸鏅€氬厓绱?榛樿鏅€氬厓绱?;direction 鏂瑰悜(y);x--妯悜锛寉--绔栧悜 var _scrollTop=$(e).scrollTop(),_offsetTop=$(this).offset().top,speed=$(this).data('visual-speed')||0.1,type=$(this).data('visual-type')||'',direction=$(this).data('visual-direction')||'y',cl=$(this).data('visual-class')||''; if(_offsetTop<_scrollTop+winH &&_offsetTop+winH>_scrollTop){ var position=speed*_scrollTop; if(cl){ if(direction=='y'){//绔栧悜 if(!type){//鏅€氬厓绱 $(this).css({'transform':'translateY('+position+'px)','transition':'0s'}); }else{//鑳屾櫙鍥剧墖 $(this).css({'background-position':'center '+position+'px'}); } }else{//妯悜 if(!type){//鏅€氬厓绱 $(this).css({'transform':'translateX('+position+'px)','transition':'0s'}); }else{//鑳屾櫙鍥剧墖 $(this).css({'background-position':''+position+'px center'}); } } if(cl=='servicesR'){ $(this).css({'transform':'rotate(180deg) translateY('+position+'px)','transition':'0s'}); } } if(type=='powers'){ that.digitalIncreasing(); } $(this).addClass('Visual'); }else{ //$(this).removeClass('Visual'); } }); } }, //寮圭獥 Layer:function(e){ var type=$(e).data('type'); $('.lh-layers[data-type='+type+']').css({transform: 'translate(-50%,-50%)',visibility: 'visible'}); //$('body').addClass('Layers'); if(!$(e).data('shadow')){ var shadow ='
'; $('body').append(shadow); $('body').bind('mousewheel', function(event, delta) {return false;}); } }, closeLayer:function(e){ $(document).on('click','.closes,.shadows',function(){ var type = $(this).attr('data-type'); $('.lh-layers[data-type='+type+']').removeAttr('style'); $('.shadows[data-type='+type+']').remove(); $('body').unbind('mousewheel'); }); //鍏抽棴鍥剧墖寮圭獥 $(document).on('click','.lh-imgLayer-close',function(){ $('.lh-imgLayer-banner,.lh-teamLayer-banner').remove();$('body').removeClass('overflow');$('body').unbind('mousewheel'); }); $(document).on('click','.lh-videoLayer-close',function(){ $('.lh-video-layer').addClass('Close'); $('body').removeClass('overflow'); setTimeout(function(){ $('.lh-video-layer').remove(); },450); $('body').unbind('mousewheel'); }); $('.lh-message-close').click(function(){ $('body').removeClass('messageLayer'); }); }, imgLayer:function(e){ var that=this, index = $(e).data('index')||0; var liLength = $(e).parents('ul').children().length,li=''; if(liLength>1){//澶氫釜 if(that.winInfo()._winW<=980){ if($(e).data('video')){ var img = $(e).data('video'); li='
  • '; }else{ $($(e).parents('ul').children()).each(function(){ if($(this).find('.imgBtn').data('video')){ var img = $(this).find('.imgBtn').data('video'); li+='
  • '; }else{ var img = $(this).find('.imgBtn').data('bigimg'); li+='
  • '; } }); } }else{ $($(e).parents('ul').children()).each(function(){ if($(this).find('.imgBtn').data('video')){ var img = $(this).find('.imgBtn').data('video'); li+='
  • '; }else{ var img = $(this).find('.imgBtn').data('bigimg'); li+='
  • '; } }); } }else{//鍗曚釜 if($(e).data('video')){ var img = $(e).data('video'); li+='
  • '; }else{ var img = $(e).data('bigimg'); li+='
  • '; } } var html='
    '; $('body').append(html).addClass('overflow'); /*if($(window).width()<=980){ $('.lh-imgLayer-banner li>div').each(function () { new RTP.PinchZoom($(this), {}); }); }*/ if(liLength>1){ var swiper = that.setBanner({boxCell:'.lh-imgLayer-banner',effect:'slide',prevEl:'.prevn',nextEl:'.nextn',on:{ slideChangeTransitionStart:function(){ var realIndex = this.realIndex; if(this.$wrapperEl.children('li').find('video').length>0){ var arrVideo = this.$wrapperEl.children('li').find('video'); for(i=0;i'; $('body').append(html).addClass('overflow'); $('body').bind('mousewheel', function(event, delta) {return false;}); } }, zxLayer:function(e){ if($('body').hasClass('messageLayer')){ $('body').removeClass('messageLayer') }else{ $('body').addClass('messageLayer') } }, //涓嬫媺鏁堟灉 selects:function(e){ $('.lh-select').on('click','dd p',function(){ var value=$(this).data('value'); $(this).parents('.lh-select').attr('data-value',value); $(this).parents('.lh-select').find('span').text(value); }); }, //椤甸潰涓粴鍔ㄦ潯鏁堟灉 scrolls:function(e){ $('.scrolls').hover(function(){ $('body').bind('mousewheel', function(event, delta) {return false;}); },function(){ $('body').unbind('mousewheel'); }); }, //鏂囧瓧鎵撴暎鏁堟灉 splitText:function(e){ if($('.splitText').length>0){ var mySplitText =new SplitText(".splitText", {type:"chars"}); chars = mySplitText.chars; TweenMax.staggerFrom(chars,1, {opacity:0, ease:Back.easeOut}, 0.1); } }, //绔嬪嵆鍜ㄨ consult:function(e){ $(document).on('click','.lhLjzx',function(){ var url = $(this).attr('href'); var str=new RegExp("http"); if(str.test(url)){ window.open(url,'newindow','height=600,width=900,top=200,left=300,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no'); return false; } }); }, //瀛楃涓叉崲琛 stringSplit:function(e){ $('.lhSplit').each(function(){ var text = $(this).text().split(' '); if(text.length==2){ $(this).html(text[0]+'
    '+text[1]); } if(text.length==4){ $(this).html(text[0]+' '+text[1]+'
    '+text[3]+''+text[4]); } }); }, //鏁板瓧閫掑 digitalIncreasing:function(e){ if($('.power').length>0){ $('.power').each(function(j,e){ var _this=$(this), to = Number($(this).data('to'))||Number($(this).text()),from = Number($(this).data('from'))||0,speed = $(this).data('speed')||2000; var refreshInterval=100; var loops = Math.ceil(speed / refreshInterval), increment = Math.ceil((to - from) / loops); var n,num=0; n = setInterval(function(){ num+=increment; _this.text(num); if(_this.parents('.progress').length>0){ _this.parents('.progress').find('.bd').css({width:''+num+'%'}); } if(num>=to){ _this.text(to); clearInterval(n); } _this.removeClass('power') },refreshInterval); }); } }, //鍒嗕韩 lhShare:function(e){ if(e=='xinlang'){ window.open('http://v.t.sina.com.cn/share/share.php?title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(location.href)+'&source=bookmark','_blank','width=450,height=400'); } if(e=='weixin'){ if($('#lhCode').length>0){ return false; } var html = '

    鍒嗕韩鍒 - 寰俊

    '; $('body').append(html); $('#lhCode>.ewm').qrcode(location.href); $('#lhCode>h2>i').click(function(){ $('#lhCode').remove(); }); } if(e=='kongjian'){ window.open('https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+encodeURIComponent(location.href)+'&pics=&summary='+encodeURIComponent(document.title),'_blank','width=450,height=400'); } if(e=='qqhy'){ window.open('https://connect.qq.com/widget/shareqq/index.html?url='+encodeURIComponent(location.href)+'&desc='+encodeURIComponent(document.title)+'&pics=&site=','_blank','width=816,height=666,left=40,top=80'); } }, //杩斿洖椤堕儴 returnTop:function(e){ $('body,html').animate({scrollTop:'0px'}); }, //榧犳爣璺熼殢 cursorFollow:function(e){ var a=$('.case-item li'); a.on("mouseenter",function(){ TweenMax.to($('.lh-cursor .learn-more'), .2,{opacity:1,scale:1}); }); a.on("mouseleave",function(){ TweenMax.to($('.lh-cursor .learn-more'), .2,{opacity:0,scale:0}); }); $('a').on("mouseenter",function(){ if($(this).parents('.swiper-container-horizontal').length<=0||$(this).parents('.swiper-container-horizontal').hasClass('history-bd')||$(this).parents('.swiper-container-horizontal').hasClass('team-banner')){ TweenMax.to($('.lh-cursor .dot'), .2,{opacity:0,scale:0}); TweenMax.to($('.lh-cursor .circle'), .2,{scale:.4}); if($(this).hasClass('about-more')){ $('.lh-cursor .circle').css({'border-color':'#fff'}); } } }); $('a').on("mouseleave",function(){ if($(this).parents('.swiper-container-horizontal').length<=0||$(this).parents('.swiper-container-horizontal').hasClass('history-bd')||$(this).parents('.swiper-container-horizontal').hasClass('team-banner')){ TweenMax.to($('.lh-cursor .dot'), .2,{opacity:1,scale:1}); TweenMax.to($('.lh-cursor .circle'), .2,{scale:.2}); if($(this).hasClass('about-more')){ $('.lh-cursor .circle').css({'border-color':'var(--color-pink)'}); } } }); $('.swiper-container-horizontal .bd').on("mouseenter",function(){ if($(this).parent().hasClass('lh-banner')||$(this).parent().hasClass('history-bd')||$(this).parent().hasClass('cooperation-honor-banner')||$(this).parent().hasClass('team-banner')){ return; } TweenMax.to($('.lh-cursor .dot'), .2,{opacity:0,scale:0}); TweenMax.to($('.lh-cursor .circle'), .2,{scale:1}); TweenMax.to($('.lh-cursor .page'), .2,{opacity:1}); }); $('.swiper-container-horizontal .bd').on("mouseleave",function(){ if($(this).parent().hasClass('lh-banner')||$(this).parent().hasClass('history-bd')||$(this).parent().hasClass('team-banner')){ return; } TweenMax.to($('.lh-cursor .dot'), .2,{opacity:1,scale:1}); TweenMax.to($('.lh-cursor .circle'), .2,{scale:.2}); TweenMax.to($('.lh-cursor .page'), .2,{opacity:0}); }); $('body').on('mousemove',function(e){ var clientX=e.clientX,clientY=e.clientY; var scrollLeft=$(this).scrollLeft(),scrollTop=$(this).scrollTop(); var left = clientX+scrollLeft,top=clientY+scrollTop; myTween = TweenMax.to($('.lh-cursor'), .5,{x:clientX,y:clientY}); }) }, randomNum:function(min,max){ var range = max - min; var rand = Math.random(); var num = min + Math.round(rand * range); return num; }, //echarts 鍦板浘 setEchartsMap:function(_datas){ var uploadedDataURL="/style/js/data.json"; var myChart=echarts.init($('#myChart')[0]); myChart.showLoading(); var index = -1; var scale=3; var fontSize=14; var symbolSize=8; var show=true; if($(window).width()<=980){ scale=1.5; fontSize=8; symbolSize=5; show=false; } //缁勮鏁版嵁鐢ㄤ簬鍒ゆ柇鍝簺鐪佷唤鏄剧ず var _showName=[]; for(var i=0;i<_datas.length;i++){ _showName.push(_datas[i].nname); } //缁勮鏁版嵁鐢ㄤ簬绾挎潯鏄剧ず var _lineDatas=[]; var _endValue; for(var i=0;i<_datas.length;i++){ if(_datas[i].end){ _endValue=_datas[i].value; } } $.getJSON(uploadedDataURL, function (geoJson) { var geoJson=geoJson.features; for(var i=0;i<_datas.length;i++){ if(!_datas[i].end){ if(!_datas[i].value || _datas[i].value=='undefined'){ for(var j=0;j'; }else{ return ''; } } }; } }, geo: { map: "china", selectedMode:false, aspectScale: 0.75, //闂€鍨啍濮o拷 zoom: 1.1, roam: false, itemStyle: { normal: { areaColor: { type: "radial", x: 0.5, y: 0.5, r: 0.8, colorStops: [ { offset: 0, color: "#09132c", // 0% 婢跺嫮娈戞0婊嗗 }, { offset: 1, color: "#274d68", // 100% 婢跺嫮娈戞0婊嗗 }, ], globalCoord: true, // 缂傝櫣娓锋稉锟 false }, shadowColor: "rgb(58,115,192)", shadowOffsetX: 10, shadowOffsetY: 11, }, }, emphasis:{ itemStyle: { areaColor: "red" } }, regions: [ { name: "閸楁鎹g拠绋跨煗", itemStyle: { areaColor: "rgba(0, 10, 52, 1)", borderColor: "rgba(0, 10, 52, 1)", normal: { opacity: 0, label: { show: false, color: "#009cc9", }, }, }, }, ], }, series: [ { type: "map", selectedMode:false, roam: false, label: { normal: { show: show, textStyle: { color: "#1DE9B6", fontSize:fontSize }, }, }, itemStyle: { normal: { borderColor: "rgb(147, 235, 248)", borderWidth: 1, areaColor: { type: "radial", x: 0.5, y: 0.5, r: 0.8, colorStops: [ { offset: 0, color: "#09132c", // 0% 婢跺嫮娈戞0婊嗗 }, { offset: 1, color: "#274d68", // 100% 婢跺嫮娈戞0婊嗗 }, ], globalCoord: true, // 缂傝櫣娓锋稉锟 false }, }, emphasis:{ areaColor: "#C90007", label:{ color:'#fff' } }, }, zoom: 1.1, // roam: false, map: "china", //娴h法鏁 // data: this.difficultData //閻戭厼濮忛崶鐐殶閹癸拷 娑撳秴鎮撻崠鍝勭厵 娑撳秴鎮撻惃鍕俺閼癸拷 }, { type: "effectScatter", coordinateSystem: "geo", showEffectOn: "render", zlevel: 1, rippleEffect: { period: 15, scale: scale, brushType: "fill", }, hoverAnimation: true, label: { normal: { formatter: "{b}", position: "right", offset: [15, 0], color: "#1DE9B6", show: true, }, }, itemStyle: { normal: { color: "#1DE9B6", shadowBlur: 10, shadowColor: "#333", }, }, symbolSize: symbolSize, data: _datas, }, //閸︽澘娴樼痪璺ㄦ畱閸斻劎鏁鹃弫鍫熺亯 { type: "lines", zlevel: 2, effect: { show: true, period: 4, //缁狀厼銇旈幐鍥ф倻闁喎瀹抽敍灞解偓鑹扮Ш鐏忓繘鈧喎瀹崇搾濠傛彥 trailLength: 0.4, //閻楄鏅ョ亸鎹愭姉闂€鍨[0,1]閸婅壈绉烘径褝绱濈亸鎹愭姉鐡掑﹪鏆遍柌锟 symbol: "arrow", //缁狀厼銇旈崶鐐垼 symbolSize: 7, //閸ョ偓鐖f径褍鐨 }, lineStyle: { normal: { color: "#1DE9B6", width: 1, //缁炬寧娼€硅棄瀹 opacity: 0.1, //鐏忔崘鎶楃痪鎸庢蒋闁繑妲戞惔锟 curveness: 0.3, //鐏忔崘鎶楃痪鎸庢蒋閺囪尙娲挎惔锟 }, }, data:_lineDatas, }, ], }; myChart.setOption(option, true); }); myChart.on("mouseover", function (params){ if(!params.name){ myChart.dispatchAction({ type: 'downplay' }); } }); $(window).resize(function(){ myChart.resize(); }) }, //鏄熺┖鑳屾櫙 setStar:function(){ var options={ "particles": { "number": { "value": 160, "density": { "enable": true, "value_area": 800 } }, "color": { "value": "#ffffff" }, "shape": { "type": "circle", "stroke": { "width": 0, "color": "#000000" }, "polygon": { "nb_sides": 5 }, "image": { "src": "img/github.svg", "width": 100, "height": 100 } }, "opacity": { "value": 1, "random": true, "anim": { "enable": true, "speed": 1, "opacity_min": 0, "sync": false } }, "size": { "value": 3, "random": true, "anim": { "enable": false, "speed": 4, "size_min": 0.3, "sync": false } }, "line_linked": { "enable": false, "distance": 150, "color": "#ffffff", "opacity": 0.4, "width": 1 }, "move": { "enable": true, "speed": 1, "direction": "none", "random": true, "straight": false, "out_mode": "out", "bounce": false, "attract": { "enable": false, "rotateX": 600, "rotateY": 600 } } }, "interactivity": { "detect_on": "canvas", "events": { "onhover": { "enable": true, "mode": "bubble" }, "onclick": { "enable": true, "mode": "repulse" }, "resize": true }, "modes": { "grab": { "distance": 400, "line_linked": { "opacity": 1 } }, "bubble": { "distance": 250, "size": 0, "duration": 2, "opacity": 0, "speed": 3 }, "repulse": { "distance": 400, "duration": 0.4 }, "push": { "particles_nb": 4 }, "remove": { "particles_nb": 2 } } }, "retina_detect": true }; if($('#particles-js').length>0)particlesJS('particles-js',options); } } Lplug.Init();