$((function(){var navLi=$(".history-nav li");$(window).width();if(navLi.on("click",(function(){var _this=$(this),toBox=$(this).attr("data-to"),top=$("."+toBox).offset().top;_this.addClass("active").siblings().removeClass("active"),$("html, body").animate({scrollTop:top-160});var text=_this.text();Global.trackEvent("AboutGWM_History_Tab_"+text)})),Tool.isMobile()?($(".his-nav-ms").on("click",(function(){Global.trackEvent("关于长城_发展历程_点击年份");var _this=$(this),toBox=$(this).attr("data-to"),top=$("."+toBox).offset().top;_this.addClass("active").siblings().removeClass("active"),$("html, body").animate({scrollTop:top-110})})),setTimeout((function(){new Swiper(".investor_tit",{slidesPerView:2,spaceBetween:0,freeMode:!0,navigation:{nextEl:".investor_tit_next"}})}),500)):($(".mb-his-nav").on("click",(function(){Global.trackEvent("关于长城_发展历程_点击年份");var _this=$(this),toBox=$(this).attr("data-to"),top=$("."+toBox).offset().top;_this.addClass("active").siblings().removeClass("active"),$("html, body").animate({scrollTop:top-110})})),setTimeout((function(){new Swiper(".investor_tit",{slidesPerView:"auto",spaceBetween:0,freeMode:!0,navigation:{nextEl:".investor_tit_next"}})}),500)),$(window).on("scroll",(function(){var top=document.documentElement.scrollTop||document.body.scrollTop,pageTop=$(".banner-pr").height(),headerHeight=$(".gwm-header").height();top>pageTop-90?($(".history-page").addClass("fixed"),$(".history-nav, .nav-box-top").css({top:headerHeight+"px"})):($(".history-page").removeClass("fixed"),$(".history-nav, .nav-box-top").css({top:0}))})),Tool.isMobile()){var navWidth=window.innerWidth/6;$(".btn-right").on("click",(function(){$(".banner-scroll").stop(!0,!0),$(".banner-scroll").animate({scrollLeft:navWidth})}))}var navList=[];if(window.onload=function(){setTimeout((function(){$(".his-cont").each((function(){var _this=$(this),top=_this.offset().top;navList.push({top:top,obj:_this,height:_this.height()})}))}),500)},Tool.isMobile())var navSections=$(".his-nav-ms");else navSections=$(".mb-his-nav");var scrollFn=Tool.debounce((function(){var top=$(document).scrollTop(),winHeight=window.innerHeight,bodyHeight=$("body").height(),bannerHeight=$(".banner-pr").height(),headHeight=$(".gwm-header").height(),navWidth=window.innerWidth/6,_top=top+headHeight+$(".investor_tit").height(),curIndex=0;if(top+winHeight>=bodyHeight-50){curIndex=navSections.length-1,navSections.eq(curIndex).addClass("active").siblings().removeClass("active");var offLeft=curIndex*navWidth;$(".banner-scroll").animate({scrollLeft:offLeft})}else{if(top<bannerHeight){curIndex=0,navSections.eq(curIndex).addClass("active").siblings().removeClass("active");offLeft=curIndex*navWidth;$(".banner-scroll").animate({scrollLeft:offLeft})}for(var i=0;i<navList.length-1;i++){var item=navList[i];if(item.top<_top&&_top<item.top+item.height){curIndex=i,navSections.eq(curIndex).addClass("active").siblings().removeClass("active");offLeft=curIndex*navWidth;$(".banner-scroll").animate({scrollLeft:offLeft});break}}}}),200);scrollFn(),$(window).on("scroll",scrollFn)}));