var isSupportTouch = (!!('ontouchend' in document) || navigator.userAgent.indexOf('Windows Phone') > 0); function goSearch(url) { window.location.href = url; } if($(window).width()<=1024){ $("a").each(function(i){ $(this).attr("target","_self"); }) } /*发展历程*/ function devGet(target,menuLeft,menuRight){ var targetBlock=target; var targetContainer=".swiper-container"; var targetWrapper=".swiper-wrapper"; var targetSwiper=".swiper-slide"; var targetLeft=menuLeft; var targetRight=menuRight; var devCount2=0; var saveBlock2 = $(targetBlock+" "+targetWrapper).html(); $(targetBlock+" "+targetSwiper).removeClass().addClass(targetSwiper); $(targetBlock+" "+targetWrapper).html(saveBlock2); $(targetBlock+" "+targetLeft).off('click'); $(targetBlock+" "+targetRight).off('click'); if ($(window).width() >= 768) { var mySwiper2 = new Swiper(targetBlock+" "+targetContainer, { resizeReInit: true, slidesPerView: 8, loop:true, onTouchEnd: function(swiper){ if(mySwiper2.activeIndex>=$(targetBlock).find(targetSwiper).size()-8){ $(targetBlock+" "+targetLeft).removeClass("on"); $(targetBlock+" "+targetRight).addClass("on"); }else if(mySwiper2.activeIndex<=0){ $(targetBlock+" "+targetRight).removeClass("on"); $(targetBlock+" "+targetLeft).addClass("on"); }else{ $(targetBlock+" "+targetRight).removeClass("on"); $(targetBlock+" "+targetLeft).removeClass("on"); } } }) } else { var mySwiper2 = new Swiper(targetBlock+" "+targetContainer, { resizeReInit: true, slidesPerView: 3 }) } $(targetBlock+" "+targetSwiper+":eq(0)").addClass("on"); $(targetBlock+" "+targetLeft).on('click', function (e) { e.preventDefault(); // if(devCount2<=1){ // $(targetBlock+" "+targetLeft).addClass("on"); // } // if(devCount2<=0){ // // }else{ // devCount2--; // $(targetBlock).find(targetSwiper).eq(devCount2).addClass("on"); // $(targetBlock).find(targetSwiper).eq(devCount2).siblings().removeClass("on"); // $(targetBlock+" "+targetRight).removeClass("on"); // } mySwiper2.swipePrev(); }) $(targetBlock+" "+targetRight).on('click', function (e) { e.preventDefault() // if(devCount2>=$(targetBlock).find(targetSwiper).size()-9){ // $(targetBlock+" "+targetRight).addClass("on"); // } // if(devCount2>=$(targetBlock).find(targetSwiper).size()-8){ // // }else{ // devCount2++; // $(targetBlock).find(targetSwiper).eq(devCount2).addClass("on"); // $(targetBlock).find(targetSwiper).eq(devCount2).siblings().removeClass("on"); // $(targetBlock+" "+targetLeft).removeClass("on"); // } mySwiper2.swipeNext() }) } function ajax_index(url){ $.ajax({ url: url, type: "GET", success: function (msg) { $(".ind-part3-main").html(msg); if($(window).width()<=1024){ $("a").each(function(i){ $(this).attr("target","_self"); }) } } }); } var getHref=[]; var getType=""; var getCount=1; var getLength=0; $(function(){ $(".ind-part3-top-right dd").click(function(e){ var nIndex=$(".ind-part3-top-right dd").index(this); e.preventDefault(); getCount=1; $(".ind-part3-more a:eq("+nIndex+")").removeClass().addClass("on").siblings().removeClass("on"); $(".ind-part3-top-right dd").removeClass("on"); $(this).addClass("on"); ajax_index($(this).find("a").attr("href")); }) $(".ind-part3-top-right dd:eq(0)").trigger("click"); $(".ind-part3-top-right > a").click(function(){ ajax_change(); }) }) function ajax_change(){ $(".ind-part3-top-right dd").each(function(){ if($(this).hasClass("on")){ getType=$(this).find("a").attr("href").split(".")[1]; getHref=$(this).find("a").attr("href").split(".")[0].split("_"); getLength=Number($(this).find("a").data("max")); if(getCount>getLength-1){ getCount=1; getHref=getHref.join("_")+"."+getType; }else{ getCount++; getHref=getHref.join("_")+"_"+getCount+"."+getType; } ajax_index(getHref); } }) } function ajaxFun_now1(url) { $.ajax({ url: url, type: "GET", success: function (msg) { $(".about_history_main_main ul").html(msg); if($(window).width()<=1024){ $("a").each(function(i){ $(this).attr("target","_self"); }) } } }); } /*导航*/ function compareHeight(){ var arr=[]; $(".about_culture_part1 li dl").attr("style",""); if($(".header-top-right-menu").is(":hidden")){ $(".about_culture_part1 li").each(function(){ var getHeight=$(this).find("dl").height(); arr.push(getHeight); }) var max = arr[0]; for(var i=1;i=theHeight){ $(".footer-nav").removeClass("on"); }else{ $(".footer-nav").addClass("on"); } if($(window).scrollTop()>0){ $(".page_arr_up").addClass("on"); }else{ $(".page_arr_up").removeClass("on"); } }) //if($(".in_menu").is(":visible")){ if($(window).width()<768){ $(".ind-part2-txt").each(function(){ $(this).find("img").attr("src",$(this).find("img").attr("data-src")); }) } var in_menu_bot=null; $(".index-banner-device .in_menuNav_bottom span").hover(function(){ clearTimeout(in_menu_bot); $(this).find("dl").show(); $(this).siblings().find("dl").hide(); },function(){ var getThis=$(this); in_menu_bot=setTimeout(function(){ getThis.find("dl").hide(); },100) }) var in_menu_other=null; $(".header-nav-center li,.footer-top em").hover(function(){ clearTimeout(in_menu_other); $(this).find("dl").addClass("on"); $(this).siblings().find("dl").removeClass("on"); },function(){ var getThis=$(this); in_menu_other=setTimeout(function(){ getThis.find("dl").removeClass("on"); },100) }) $(".phone_search_menu").click(function(){ if($(".header-top-right-search").hasClass("on")){ $(".phone_search_menu").removeClass("glyphicon-remove").addClass("glyphicon-search"); $(".header-top-right-search").removeClass("on"); }else{ $(".phone_search_menu").removeClass("glyphicon-search").addClass("glyphicon-remove"); $(".header-top-right-search").addClass("on"); setTimeout(function(){ $(".header-top-right-search input").focus(); },100) $(".nav_phone_btn").removeClass("visible_nav"); $(".in_top_menuNav").removeClass("on"); $(".header-top").removeClass("on"); return false; } }) $(".header-top-right-search input,.header-top-right-search button").click(function(event){ event.stopPropagation(); }) $(document).click(function(){ $(".phone_search_menu").removeClass("glyphicon-remove").addClass("glyphicon-search"); $(".header-top-right-search").removeClass("on"); }) //} $(".form-select").click(function(){ if($(this).find("dl").is(":hidden")){ $(this).find("dl").show(); return false; }else{ $(this).find("dl").hide(); } }) $(".form-select dd").click(function(){ $(".form-select input").val($(this).text()).attr("value",$(this).text()); }) $(document).click(function(){ $(".form-select dl").hide(); }) countNumer($(".about_intro_part2_t b:eq(0)"),20) countNumer($(".about_intro_part2_t b:eq(1)"),5) countNumer($(".about_intro_part2_t b:eq(2)"),2) countNumer($(".ser_index_part1_l_txt em:eq(0)"),4) countNumer($(".ser_index_part1_l_txt em:eq(1)"),2000) countNumer($(".ser_index_part1_l_txt em:eq(2)"),100) $(window).resize(function(){ $(document).off("click",".nav_phone_btn"); $(document).on("click",".nav_phone_btn",function(){ if($(this).hasClass("visible_nav")){ $(this).removeClass("visible_nav"); $(".header").removeClass("on"); $(".menu").removeClass("on"); }else{ $(this).addClass("visible_nav"); $(".header").addClass("on"); $(".menu").addClass("on"); $(".phone_search_menu").removeClass("glyphicon-remove").addClass("glyphicon-search"); $(".header-top-right-search").removeClass("on") return false; } }) compareHeight(); }) $(window).resize(); if($(window).width()<1023){ //添加关闭按钮 var subMenu = $('.sub'); var back = '
<返回
'; var subHide = $(back); subHide.prependTo(subMenu); $('.menu li.hassub span').click(function(){ $(this).next(".sub").addClass('on'); }); $('.hide-sub').on('click', function () { $(this).parents(".sub").removeClass('on'); }); } if($(window).width()<768){ $(".ind-part2 .row").each(function(){ $(this).find(".col-md-8").prependTo($(this)); }) } var count_add = 0; var addTimer = null; var count_add1 = 0; var addTimer1 = null; var count_add2 = 0; var addTimer2 = null; if (!isSupportTouch) { addTimer = setInterval(function () { count_add += Math.floor(Math.random() * 100); if (count_add >= Number($(".scrollNum").attr("rel"))) { $(".scrollNum").text(Number($(".scrollNum").attr("rel"))); } else { $(".scrollNum").text(count_add); } }, 10) addTimer1 = setInterval(function () { count_add1 += Math.floor(Math.random() * 400); if (count_add1 >= Number($(".scrollNum1").attr("rel"))) { $(".scrollNum1").text(Number($(".scrollNum1").attr("rel"))); } else { $(".scrollNum1").text(count_add1); } }, 10) addTimer2 = setInterval(function () { count_add2 += Math.floor(Math.random() * 5); if (count_add2 >= Number($(".scrollNum2").attr("rel"))) { $(".scrollNum2").text(Number($(".scrollNum2").attr("rel"))); } else { $(".scrollNum2").text(count_add2); } }, 10) } else { $(".scrollNum").text($(".scrollNum").attr("rel")); $(".scrollNum1").text($(".scrollNum1").attr("rel")); $(".scrollNum2").text($(".scrollNum2").attr("rel")); } supportPlaceholder = 'placeholder' in document.createElement('input'), placeholder = function (input) { var text = input.attr('placeholder'), defaultValue = input.defaultValue; if (!defaultValue) { input.val(text).addClass("phcolor"); } input.focus(function () { if (input.val() == text) { $(this).val(""); } }); input.blur(function () { if (input.val() == "") { $(this).val(text).addClass("phcolor"); } }); //输入的字符不为灰色 input.keydown(function () { $(this).removeClass("phcolor"); }); }; //当浏览器不支持placeholder属性时,调用placeholder函数 if (!supportPlaceholder) { $('input').each(function () { text = $(this).attr("placeholder"); if ($(this).attr("type") == "text") { placeholder($(this)); } }); } }) function countNumer(target,rand){ var count_add = 0; var addTimer = null; addTimer = setInterval(function () { count_add += Math.floor(Math.random() * rand); if (count_add >= Number($(target).attr("rel"))) { $(target).text(Number($(target).attr("rel"))); } else { $(target).text(count_add); } }, 10) }