//wow閰嶇疆 var wow = new WOW({ boxClass: 'wow', animateClass:'animated', offset:0, mobile:false, live: true }); function isMobile() { var userAgentInfo = navigator.userAgent; var mobileAgents = [ "Android", "iPhone", "SymbianOS", "Windows Phone", "iPad","iPod"]; var mobile_flag = false; //鏍规嵁userAgent鍒ゆ柇鏄惁鏄墜鏈 for (var v = 0; v < mobileAgents.length; v++) { if (userAgentInfo.indexOf(mobileAgents[v]) > 0) { mobile_flag = true; break; } } var screen_width = window.screen.width; //鏍规嵁灞忓箷鍒嗚鲸鐜囧垽鏂槸鍚︽槸鎵嬫満 if(screen_width < 992){ mobile_flag = true; } return mobile_flag; } var public_banner; $(function(){ //鏁板瓧鍔ㄧ敾 $('.counter').countUp({ delay: 10, time: 2000 }); //wow鍒濆鍖 wow.init(); //瑙嗚宸 if(!isMobile()){ $(window).scroll(function () { var pos = window.pageYOffset; $(".banner").children(".banner_bg").css('transform','scale('+(1+pos*0.0001)+')'); }) } //鍐呴〉banner鍒囨崲 if($('#public_banner').length!=0){ public_banner = new Swiper ('#public_banner', { loop: true, speed: 1000, effect: 'fade', autoplay: { delay: 4000, disableOnInteraction: false, }, }); } //header棰滆壊 if(isMobile()){ $('.header').addClass('onWhite').after('
').find('.header_logo a').html(''); $(document).on('click','#menuNavBtn',function(){ if($('.header').is('.mobileNav')){ $('.header').removeClass('mobileNav'); $('.videoBg').show(); }else{ $('.header').addClass('mobileNav'); $('.videoBg').hide(); } }); //鏄剧ず浜岀骇 let onLi = $('.header .nav .navA>.navA_item.on'); if(onLi.length!=0){ if(onLi.children('.navB').length!=0){ let tooh = onLi.children('.navB').outerHeight(); onLi.height(tooh+50); } } $(document).on('click','.nav .navA>.navA_item',function(){ let is = $(this); if(is.children('.navB').length==0){ window.location.href = is.children('a').attr('href'); }else{ if(is.is('.on')){ is.removeClass('on').height(50); }else{ let tooh = is.children('.navB').outerHeight(); is.addClass('on').height(tooh+50).siblings().removeClass('on').height(50); } } }); //鐐瑰嚮浜岀骇 $(document).on('click','.nav .navB>.navB_item',function(){ $('.header').removeClass('mobileNav'); $('.videoBg').show(); }); }else{ if($('.header').data('type')==2){ $('.header').addClass('onWhite').after('
').find('.header_logo a').html(''); }else{ $(document).scroll(function () { if($('.header').attr('style')==undefined || $('.header').attr('style')==''){ var dom = $(this).scrollTop(); if(dom > $(window).height()/3){ !$('.header').is('.onWhite')?$('.header').addClass('onWhite').find('.header_logo a').html(''):''; }else{ $('.header').is('.onWhite')?$('.header').removeClass('onWhite').find('.header_logo a').html(''):''; } } }); //鏄剧ず浜岀骇 $(".navA").hover(function(){ !$('.header').is('.onWhite')?$('.header').addClass('onWhite').find('.header_logo a').html(''):''; },function(){ var tops = $(document).scrollTop(); if(tops <= $(window).height()/3){ $('.header').is('.onWhite')?$('.header').removeClass('onWhite').removeAttr('style').find('.header_logo a').html(''):''; }else{ $('.header').removeAttr('style'); } }); } } //椤靛ご鍦嗙偣璺熼殢 if(!isMobile() && $("#float_circle").length!=0){ var pos = $(".navA>.navA_item.on"); pos.length!=0?floatCircle(pos):''; $(".navA>.navA_item").hover(function(){ let centerW = ($(this).children('a').innerWidth() - $(this).children('a').width())/2; $("#float_circle").addClass("float_exhibit").css({"left":parseFloat($(this)[0].offsetLeft + centerW)+"px","width":$(this).children('a').width()}); if($(this).children('.navB').length!=0){ $('.header').height($(this).children('.navB').innerHeight()+80); }else{ $('.header').removeAttr('style'); } },function(){ if($('.header').data('type')==2 && $('.header').attr('style')!=undefined || $('.header').attr('style')!=''){ $('.header').removeAttr('style'); } }); $(".nav").mouseleave(function (){ floatCircle(pos); }); } function floatCircle(Lnum){ let centerW = (Lnum.children('a').innerWidth() - Lnum.children('a').width())/2; $("#float_circle").addClass("float_exhibit").css({"left":parseFloat(Lnum[0].offsetLeft + centerW)+"px","width":Lnum.children('a').width()}); } //鑿滃崟灞曞紑鏀惰捣 $(document).on('click','#menu_btn',function(){ if($('.header').is('.onshow')){ $('.header,.nav').removeClass('onshow'); }else{ $('.header,.nav').addClass('onshow'); } }); //璇█鍒囨崲 $(document).on('click','#other_ce',function(){ var is = $(this); if(is.parent().is('.on')){ is.parent().removeClass('on'); }else{ is.parent().addClass('on'); } }); $(document).click(function(event){ var _con = $('#other_ce'); if(!_con.is(event.target) && _con.has(event.target).length === 0){ _con.parent().removeClass('on'); } }); //澶撮儴鎼滅储 $(document).on('click','#other_searc',function(){ var is = $(this); if(is.parent().is('.on')){ is.parent().removeClass('on'); }else{ is.parent().addClass('on'); } }); $(document).on('click','.other_searc_close',function(){ var is = $(this); is.parents().removeClass('on'); }); //浼佷笟鏂囧寲灞曞紑鏇村 // $(document).on('click','#cultureShow',function(){ // $('.culture_list').addClass('on'); // }); //绛涢€夋煡璇 $(document).on('click','.select_btn>div>a',function(){ var is = $(this); is.find('.select_val').focus(); if(is.parent().is('.on')){ is.parent().removeClass('on'); }else{ is.parent().addClass('on').parent().siblings('.select_btn').children().removeClass('on'); } }); $(document).click(function(event){ var _con = $('.select_btn>div>a'); if(!_con.is(event.target) && _con.has(event.target).length === 0){ $('.select_btn>div').removeClass('on'); } }); $(document).on('click','.select_btn ul a',function(){ var is = $(this),txt = is.text(); is.parents('ul').siblings('a').find('span').text(txt).siblings('input').val(txt=='鍏ㄩ儴'?'':txt).blur(); }); $(".query_btn input").focus(function(){ var is = $(this); is.parent().parent().addClass('on'); }); $(".query_btn input").blur(function(){ var is = $(this); is.parent().parent().removeClass('on'); }); //棣栭〉涓氬姟婊氬姩 if($("#plate_box").length!=0){ if(!isMobile()){ if($("#plate_box").find('.swiper-slide').length>1){ var lg = $("#plate_box").find('.swiper-slide:first-child').children('.plate_line'); $("#plate_box").height(lg.height()*2); var plate = new Swiper ('#plate_box', { speed:500, direction:'vertical', slidesPerView :2, mousewheel: { releaseOnEdges: true, }, }); } } } // 绾挎潯鍔ㄧ敾 if ($('#ckLine').length > 0) { $('#ckLine').ckLine({ leftRight: false, strokeColor: 'rgba(204,48,31,.1)', interval: 800, animateTime: 1600, animationTimeRange: [800, 1600] }); } //涓氬姟鍒楄〃 if ($('#business').length > 0) { var business = new Swiper ('#business', { speed:500, loop: true, followFinger:true, mousewheel: true, slidesPerView:1, breakpoints: { 768:{ slidesPerView:2, followFinger:false, }, 992:{ slidesPerView:3, followFinger:false, } }, navigation: { nextEl: '#business_btnNext', prevEl: '#business_btnPrev', }, }); } //鑱旂郴鎴戜滑tab $(document).on('click','#contact_tab a',function(){ var is = $(this); is.addClass('on').parent().siblings().find('a').removeClass('on'); $('.contact_list').children('.contact_li').eq(is.parent().index()).addClass('on').siblings().removeClass('on'); }); //鑱旂郴鎴戜滑寮圭獥 $(document).on('click','.contact_list .contact_list_txt',function(){ var check = $(this).attr('cid'); $('.contact_list .contact_list_txt').removeClass('on'); $(this).addClass('on'); if(isMobile()){ $('.loc_list').addClass('on').children('.contact_plate[cid='+check+']').addClass('on').siblings().removeClass('on'); }else{ $('.spot_psn[cid="'+check+'"]').addClass('on').siblings().removeClass('on'); } }); //鑱旂郴鎴戜滑鍏抽棴寮圭獥 if(isMobile()){ $(document).on('click','.loc_list',function(){ $('.contact_list_txt,.loc_list').removeClass('on'); }); } if($("#swiper_small").length!=0){ var swiper_small = new Swiper("#swiper_small", { spaceBetween: 10, slidesPerView:3, freeMode:true, breakpoints: { 992:{ slidesPerView:6, spaceBetween:10 } } }); var swiper_big = new Swiper("#swiper_big", { spaceBetween:10, loop:true, thumbs:{ swiper:swiper_small, }, }); $(document).on('click','#open_chart',function(){ $(".gallery").addClass('on'); }); $(document).on('click','#gallery_close',function(){ $(".gallery").removeClass('on'); }); } //鍦板浘瀹氱偣 if($(".spot_psn").length!=0){ $.each($(".spot_psn"), function(i,k){ if($(this).children('.spot_psn_btn').text()=='鎴愰兘' || $(this).children('.spot_psn_btn').text()=='涓婃捣' || $(this).children('.spot_psn_btn').text()=='娣卞湷'){ $(this).css({'font-size':'18px','color':'#cc3020'}); } var posi = $(this).attr('posi'); $(this).css({'left':posi.split(',')[0]+'%','bottom':posi.split(',')[1]+'%'}); }); } $("body").removeClass("transition_none"); })