(function (doc, win) { var docEl = doc.documentElement, resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize', recalc = function () { var clientWidth = docEl.clientWidth; if (!clientWidth) return; if(clientWidth>=750){ docEl.style.fontSize = '100px'; }else{ docEl.style.fontSize = 100 * (clientWidth / 750) + 'px'; } }; if (!doc.addEventListener) return; win.addEventListener(resizeEvt, recalc, false); doc.addEventListener('DOMContentLoaded', recalc, false); })(document, window); $(function(){ var _anchor=getUrlParam("anchor"); setTimeout(function(){ if(_anchor!=null){ if($("#"+_anchor)!=null){ $("body").scrollTop($("#"+_anchor).offset().top-$("#"+_anchor).height()) } } },1000); tab(".tabJs1 .titletab .tabBtnList li",".tabJs1 .titletab .tabBtnList li .line span",".tabJs1 .imgContentBox","current") tab(".tabJs2 .titletab .tabBtnList li",".tabJs2 .titletab .tabBtnList .line span",".tabJs2 .cjwt_contentBox","current") tab(".tabJs3 .titletab .tabBtnList li",".tabJs3 .titletab .tabBtnList .line span",".tabJs3 .cjwt_contentBox","current") tab(".tabJs4 .titletab .tabBtnList li",".tabJs4 .titletab .tabBtnList .line span",".tabJs4 .cjwt_contentBox ","current") tab(".tabJs6 .titletab .tabBtnList li",".tabJs6 .titletab .tabBtnList .line span",".tabJs6 .khzn_contentBox ","current") tab(".doubtBox .tabBtnList li",".doubtBox .tabBtnList li",".doubtBox .rhgmjj_content ","current"); _initInputs(); // _datePicker(); _initSelect(); // swtichTool(".loginBox .tabTitle li","active",".tabCont","click"); swtichTool(".productionBox .tipsList .item","active",".content","touchend"); // containerCenter(); /*============================*/ $(".nav_btn").bind("touchend",function(){//侧边边栏效果js 调用 openOrHideMainNav(true); return false; }); $(".main-sideBar-mask").bind("touchend",function(){ openOrHideMainNav(false); return false; }); $(".main-sideBar-mask").bind("touchmove",function(){ return false; }); /*=================================*/ $(".sidebar-menu li p.menu_head").bind("touchend",function(){ //侧边栏二级菜单点击伸展 js var animationSpeed = 300; var $this=$(this); var checkElement=$this.next(); if ((checkElement.is('.subNav') && checkElement.is(':visible'))) { checkElement.slideUp(animationSpeed); $this.children().removeClass('current'); }else if((checkElement.is('.subNav')) && (!checkElement.is(':visible'))){ var parent = $this.parents('ul').first(); var ul = parent.find('ul:visible').slideUp(animationSpeed); /*ul.slideUp(animationSpeed); */ ul.prev().children().removeClass('current'); checkElement.slideDown(animationSpeed); $this.children("span.point-icon").addClass('current'); } if(checkElement.is('.subNav')){ return false; } }) /*===================*/ /*返回顶部*/ $('#return_top').click(function() { //改元素点击的时候 $('html,body').animate({ scrollTop: 0 }, 600); //让 body 的 scroolTop 设为 0 }); _initInterceptText(); //启动截取文字功 _inithomepageEvent(); _initProductionDetailsEvent(); _initProductionDetailsEvent_jhgs_TabSwiper(); _initProductionDetailsEvent_jirongketang_content(); _initProductionDetailsEvent_jirongketang_content_wap(); //_newCustomSelectBox("#customSelectBox1 li","#customSelectBox1 li span"); _newCustomSelectBox("#selectItem1","#customSelectBox1","#customSelectBox1 li","#customSelectBox1 li span","#selectItem1 .valueTxt"); }); window.onload= function(){ rollToolVertical(".noticeList ul",".noticeList li",".noticeList",4000); $(".productionBox .tipsList .item").css({"width":(100/$(".productionBox .tipsList .item").length)+"%"}); $($(".productionBox .tipsList .item")[$(".productionBox .tipsList .item").length-1]).addClass("no_border_r"); scrollBtnshow();/*立即购买按*/ scrollBtnshow2(); moreBoxOpen(".cpzt_moreJsBtn .moreBtn",".content5 .txtContent",".cpzt_moreJsBtn .icon1",".cpzt_moreJsBtn .moreBtn p"); moreBoxOpen(".hdzt_moreJsBtn1 .moreBtn",".dzt_txtContent1",".hdzt_moreJsBtn1 .icon2",".hdzt_moreJsBtn1 .moreBtn p"); moreBoxOpen(".hdzt_moreJsBtn2 .moreBtn",".dzt_txtContent2",".hdzt_moreJsBtn2 .icon3",".hdzt_moreJsBtn2 .moreBtn p"); moreBoxOpen(".cpzt_moreJsBtn2 .moreBtn",".cpzt_contentBaox2 .txtContent",".cpzt_moreJsBtn2 .icon1",".cpzt_moreJsBtn2 .moreBtn p"); moreBoxOpen(".cpzt_moreJsBtn3 .moreBtn",".cpzt_contentBaox3 .txtContent",".cpzt_moreJsBtn3 .icon1",".cpzt_moreJsBtn3 .moreBtn p"); } //=========== input,select focus==================== function _initInputs(){ //初始化 input,select focus事件 $("input,select").focus( function(){ $(this).addClass("inputFocus"); } ); $("input,select").blur( function(){ $(this).removeClass("inputFocus"); } ); } function _initSelect(){ //初始化 input,select focus事件 $(".select").focus( function(){ $(this).addClass("selectFocus"); } ); $(".select").blur( function(){ $(this).removeClass("selectFocus"); } ); } function _datePicker(){ //初始化 input,select focus事件 $(".date_picker").focus( function(){ $(this).addClass("date_pickerFocus"); } ); $(".date_picker").blur( function(){ $(this).removeClass("date_pickerFocus"); } ); } function _inittextarea(){ //初始化 input,select focus,textarea(事件 $(".lytex").focus( function(){ $(this).addClass("inputFocus"); } ); $(".lytex").blur( function(){ $(this).removeClass("inputFocus"); } ); } function openOrHideMainNav(_open){//侧边边栏效果js if(_open){ $(".main").addClass("mainNavOpen"); $(".block-float2").addClass("mainNavOpens"); $(".main-sidebar").addClass("main-sidebar-open"); $(".main-sideBar-mask").fadeIn(400); }else{ $(".main").removeClass("mainNavOpen"); $(".block-float2").removeClass("mainNavOpens"); $(".main-sidebar").removeClass("main-sidebar-open"); $(".main-sideBar-mask").fadeOut(400); } } /*立即购买按钮 开始 滚动不同位置显示按钮*/ function scrollBtnshow(){ if($(".purchaseBtnBar .btn").length<1){ return; } var hearH=$(".mb_header").outerHeight(true); var firstBtn=$(".purchaseBtnBar .btn").offset().top; var downbtnBoxH=$(".overall").outerHeight(true); var $documentH=$(document).height(); // alert(downbtnBoxH) $(window).on("scroll",function(){ var scrollTop=$(window).scrollTop(); if(firstBtn>=scrollTop){ $(".overall .btnJS").css({"position":"","bottom":0}) }else if(firstBtn<=scrollTop){ $(".overall .btnJS").css({"position":"fixed","bottom":0}) } if(scrollTop >= $documentH - $(window).height()-(downbtnBoxH+2)){ $(".overall .btnJS").css({"position":"","bottom":0}) } }) } /*立即购买按钮 结束 滚动不同位置显示按钮*/ /*立即购买按钮 开始 滚动不同位置显示按钮*/ function scrollBtnshow2(){ if($(".zhlc_yue .btn").length<1){ return; } var firstBtn=$(".footer").offset().top; var downbtnBoxH=$(".zhlc_yue").outerHeight(true); var footerH=$(".footer").outerHeight(true); var $documentH=$(document).height(); $(window).on("scroll",function(){ var scrollTop=$(window).scrollTop(); if(firstBtn>=scrollTop){ $(".zhlc_yue").css({"position":"fixed","bottom":0}) } if(firstBtn-$(window).height()+downbtnBoxH<=scrollTop){ $(".zhlc_yue").css({"position":"relative","bottom":0}) } }) } /*立即购买按钮 结束 滚动不同位置显示按钮*/ function _inithomepageEvent(){ var mySwiper = new Swiper ('.hpBannerSwiper', { direction: 'horizontal', paginationClickable :true, autoplay: 3000, loop: true, // 如果需要分页器 pagination: '.swiper-pagination', onInit: function(swiper){ //Swiper2.x的初始化是onFirstInit swiperAnimateCache(swiper); //隐藏动画元素 swiperAnimate(swiper); //初始化完成开始动画 }, onSlideChangeEnd: function(swiper){ swiperAnimate(swiper); //每个slide切换结束时也运行当前slide动画 } }) } function _initProductionDetailsEvent(){ var mySwiper = new Swiper ('.pdtDetailesTabSwiper', { direction: 'horizontal', loop: false, slidesPerView : 4, slidesPerGroup : 4, onSlideChangeEnd: function(swiper){ swiperAnimate(swiper); //每个slide切换结束时也运行当前slide动画 } }); $(".productDetailsContentBox .tabBtnListBox .prevBtn").bind("touchend",function(){ mySwiper.slidePrev(); }); $(".productDetailsContentBox .tabBtnListBox .nextBtn").bind("touchend",function(){ mySwiper.slideNext(); }); swtichTool($(".pdtDetailesTabSwiper .swiper-slide"),"active",".informationListBox"); } function _initProductionDetailsEvent_jhgs_TabSwiper(){ var mySwiper = new Swiper ('.jhgs_TabSwiper', { direction: 'horizontal', loop: false, slidesPerView : 4, slidesPerGroup : 4, onSlideChangeEnd: function(swiper){ swiperAnimate(swiper); //每个slide切换结束时也运行当前slide动画 } }); $(".jhgs_tabBtnListBox .prevBtn").bind("touchend",function(){ mySwiper.slidePrev(); }); $(".jhgs_tabBtnListBox .nextBtn").bind("touchend",function(){ mySwiper.slideNext(); }); swtichTool_Nav($(".jhgs_tabBtnListBox .swiper-slide span"),"active",".jhgs_informationListBox"); swtichTool_Nav($(".jhgs_tabBtnListBox .swiper-slide span"),"active",".contentBox_js"); var _pid=getUrlParam("pid"); if(_pid!=null){ _pageIndex=$(".jhgs_TabSwiper .swiper-slide").index($(".jhgs_TabSwiper .swiper-slide[pid="+_pid+"]")); mySwiper.slideTo(_pageIndex,50); $($(".jhgs_TabSwiper .swiper-slide span")).removeClass("active") $($(".jhgs_TabSwiper .swiper-slide span")[_pageIndex]).addClass("active"); if($(".contentBox_js[pid="+_pid+"]")!=null){ $(".contentBox_js").css({"display":"none"}); $(".contentBox_js[pid="+_pid+"]").css({"display":"block"}); } if($(".jhgs_informationListBox[pid="+_pid+"]")!=null){ $(".jhgs_informationListBox").css({"display":"none"}); $(".jhgs_informationListBox[pid="+_pid+"]").css({"display":"block"}); } } } function _initProductionDetailsEvent_jirongketang_content(){ var mySwiper = new Swiper ('.jirongketang_content', { direction: 'horizontal', loop: true, observer: true, observeParents: true, // 如果需要分页器 pagination: '.swiper-pagination', }) } function _initProductionDetailsEvent_jirongketang_content_wap(){ var mySwiper = new Swiper ('.wap_banner', { direction: 'horizontal', loop: false, }) } //-------------------------------- function _newCustomSelectBox(_selectItem,_targetCustomSelectBox,_opationItem,_valContainer,_valTargetContainer){ $(_selectItem).bind("touchend",function(){ openCustomSelectBox(_targetCustomSelectBox); }); $($(_targetCustomSelectBox).find(".closeBtn")).bind("touchend",function(){ closeCustomSelectBox(_targetCustomSelectBox); }); var _item=$(_opationItem); $(_item).bind("touchend",function(){ var _index=$(_item).index(this); $($(_item).find(".radio")).removeClass("radioActive"); $($(this).find(".radio")).addClass("radioActive"); $(_valTargetContainer).html($($(_valContainer)[_index]).html()); closeCustomSelectBox(_targetCustomSelectBox); }); } function openCustomSelectBox(_targetCustomSelectBox){ $(_targetCustomSelectBox).addClass("customSelectBoxOpen"); $(_targetCustomSelectBox).fadeIn(200); } function closeCustomSelectBox(_targetCustomSelectBox){ $(_targetCustomSelectBox).removeClass("customSelectBoxOpen"); $(_targetCustomSelectBox).fadeOut(200); } $(function(){ $(".cpyc_contentBox li .menu_head").bind("touchend",function(){ //侧边栏二级菜单点击伸展 js var animationSpeed = 300; var $this=$(this); var checkElement=$this.next(); //$(".cpyc_contentBox li .menu_head").css({"background-color":"","color":""}); $(".cpyc_contentBox li").removeClass("current"); $(".cpyc_contentBox .introBox").slideUp(animationSpeed); // $this.children().removeClass('current'); //$(".cpyc_contentBox li .menu_head .point-icon ").removeClass('current'); if ((checkElement.is('.introBox') && checkElement.is(':visible'))) { checkElement.slideUp(animationSpeed); $this.children().removeClass('current'); $this.css({"background-color":"","color":""}); }else if((checkElement.is('.introBox')) && (!checkElement.is(':visible'))){ var parent = $this.parents('ul').first(); var ul = parent.find('ul:visible').slideUp(animationSpeed); /*ul.slideUp(animationSpeed); */ ul.prev().children().removeClass('current'); checkElement.slideDown(animationSpeed); $this.children("span.point-icon ").addClass('current'); //$this.css({"background-color":"#0180cc","color":"#fff"}); $this.parent().addClass("current"); } }); $(".cjwt_contentBox li .menu_head").bind("touchend",function(){ //侧边栏二级菜单点击伸展 js 常见问题 var animationSpeed = 300; var $this=$(this); var checkElement=$this.next(); //$(".cpyc_contentBox li .menu_head").css({"background-color":"","color":""}); $(".cjwt_contentBox li").removeClass("current"); $(".cjwt_contentBox .introBox").slideUp(animationSpeed); // $this.children().removeClass('current'); //$(".cpyc_contentBox li .menu_head .point-icon ").removeClass('current'); if ((checkElement.is('.introBox') && checkElement.is(':visible'))) { checkElement.slideUp(animationSpeed); $this.children().removeClass('current'); $this.css({"background-color":"","color":""}); }else if((checkElement.is('.introBox')) && (!checkElement.is(':visible'))){ var parent = $this.parents('ul').first(); var ul = parent.find('ul:visible').slideUp(animationSpeed); /*ul.slideUp(animationSpeed); */ ul.prev().children().removeClass('current'); checkElement.slideDown(animationSpeed); $this.children("span.point-icon ").addClass('current'); //$this.css({"background-color":"#0180cc","color":"#fff"}); $this.parent().addClass("current"); } }); /* wanQuanZhiCeXiangQingYe.html 字体大小变化 切换 js 开始位置*/ $(".timeBar span").on("touchend",function(){ var index=$(this).index(); $(".timeBar span").removeClass("Icon-colour-current"); $(this).addClass("Icon-colour-current"); if(index==0){ $(".textCenterBox .txtBoxlist").css("font-size",0.26+"rem") $(".textCenterBox .txtBoxlist p").css("font-size",0.26+"rem") }else if(index==1){ $(".textCenterBox .txtBoxlist").css("font-size",0.28+"rem") $(".textCenterBox .txtBoxlist p").css("font-size",0.28+"rem") } }); /* wanQuanZhiCeXiangQingYe.html 字体大小变化 切换 js 结束位置*/ $(".zhlc_yue").on("click",function(){ $(".popupBox").css({"display":"block"}); setTimeout(function(){ open_popup(); },50) }); $(".popupBox .close_button,.qx,.mask_popupBox ").on("click",function(){ close_popup(); setTimeout(function(){ $(".popupBox").css({"display":"none"}); },400) }); $(".jahegushi .txtContentBox .teambtn ").on("touchend",function(){ $(this).parent().parent().toggleClass("txtContentBoxOpen"); $(this).toggleClass("currentOpen"); }) /*$(".qj_inputBox .checkbox li").click(function(){//复选框 $(".qj_inputBox .checkbox li").find(".icon").removeClass("choose"); if(!$(this).find(".icon").hasClass("choose")){ $(this).find(".icon").addClass("choose"); $(this).find("input").prop("checked",true); } else{ $(this).find(".icon").removeClass("choose"); $(this).find("input").prop("checked",false); } })*/ radio(".qj_table1 .checkbox li") radio(".qj_table2 .checkbox li") function radio(obj){ $(obj).click(function(){//复选框 $(obj).find(".icon").removeClass("choose"); if(!$(this).find(".icon").hasClass("choose")){ $(this).find(".icon").addClass("choose"); $(this).find("input").prop("checked",true); } else{ $(this).find(".icon").removeClass("choose"); $(this).find("input").prop("checked",false); } }) } $(".jagoutuImgBox").on("click",function(){//组织架构 $(this).css("display","none"); $(".maxjagoutuImgBox").css("display","block"); }) $(".maxjagoutuImgBox").on("click",function(){//组织架构 $(this).css("display","none"); $(".jagoutuImgBox").css("display","block"); }) })/// function open_popup(){ $(".mask_popupBox").fadeIn(200); $(".popupBox").addClass("popupBoxOpen"); } function close_popup(){ $(".mask_popupBox").fadeOut(200); $(".popupBox").removeClass("popupBoxOpen"); } function moreBoxOpen(obj,content,btnIocn,txt){ var fal=false; $(obj).on("click",function(){ if(fal){ $(content).css("height",""); $(txt).html("查看更多") $(btnIocn).removeClass("icon-arrow_down-copy") fal=false; }else{ $(content).css("height","auto"); fal=true; $(btnIocn).addClass("icon-arrow_down-copy") $(txt).html("点击缩起") } }) }; //tab("按钮","要添加效果的盒子","要显示内容的盒子","当前状态的css类") //tab(".Online-Review .optionBtnLsit p",".Online-Review .optionBtnLsit .txt",".Online-Review-content","Tabcurrent") function tab(btnLsitObj,currentBox,contentListObj,current){ $(btnLsitObj).on("touchend",function(){ var index=$(this).index(); $(currentBox).removeClass(current); $(currentBox).eq(index).addClass(current); $(contentListObj).css("display","none"); $(contentListObj).eq(index).css("display","block"); }); } function swtichTool_Nav(_tab,_current,_content){ var _contents=$(_content); var _index=0; $(_tab).bind("touchend",function(){ $(_tab).removeClass(_current); $(this).addClass(_current); $(_content).css({"display":"none"}); var _pid=$(this).parent().attr("pid"); var _obj=$(_content+"[pid="+_pid+"]"); $(_obj).css({"display":"block"}); }); }