//导航置顶 $(window).resize(function(){ var sWSon = document.documentElement.clientWidth; if(sWSon>900){ $(window).scroll(function(){ var scrollTop = $(window).scrollTop(); if(scrollTop > 140){ $('.wraq_header').addClass('current'); //$('.ser').addClass('current'); //$('.top_right').css({display:'none'}).stop().animate({top:"-40px"},300); //$('body').css({background:'#fafaf0'}); //$("#nav ul > li").unbind("mouseenter").unbind("mouseleave"); $("#nav ul > li").unbind("mouseenter").unbind("mouseleave"); } else{ $('.wraq_header').removeClass('current'); //nav(); $("#nav ul > li").bind("mouseenter").bind("mouseleave"); // $('.ser').removeClass('current'); //nav();//电脑版导航 //$('.top_right').css({display:'block'}).stop().animate({top:0},300); //$('body').css({background:'url(images/body_bg.jpg) repeat-x #fafaf0'}); } }); }else{ $ (window).unbind ('scroll'); // $('.topWrap').css({display:'none'}); $('.header').removeClass('current'); } newsImgHeight(); }) //12.移动端顶部点击弹出下拉菜单 function Menu(menu,main){ var onOff = true; $(menu).bind('click',function (){ $(main).slideToggle(); if($(this).find('span').hasClass('fa-navicon')){ $(this).find('span').removeClass('fa-navicon'); $(this).find('span').addClass('fa-remove'); }else{ $(this).find('span').addClass('fa-navicon'); $(this).find('span').removeClass('fa-remove'); } }) $(main).find('li > span').bind('click',function (){ if($(this).hasClass('fa-chevron-right')){ $(this).removeClass('fa-chevron-right'); $(this).addClass('fa-chevron-down'); }else{ $(this).addClass('fa-chevron-right'); $(this).removeClass('fa-chevron-down'); } if($(this).parent().hasClass('on')){ $(this).parent().find('.subNavs').slideUp(); $(this).parent().removeClass('on'); return false; }; $(this).parent().siblings().removeClass('on'); $(this).parent().siblings().find('.subNavs').slideUp(); $(this).parent().addClass('on'); $(this).parent().find('.subNavs').slideDown(); }) }; // 二级页头部大图高度 function SubImgHeight(){ var iWSon = document.documentElement.clientWidth; var oSubbanner = document.getElementById('subbanner'); if(iWSon>=1300){ oSubbanner.style.height = 200+'px'; }else if(iWSon<1300){ oSubbanner.style.height = iWSon * (200/1300)+'px'; } window.onscroll = window.onresize = function (){ var iWSon = document.documentElement.clientWidth; if(iWSon>=1300){ oSubbanner.style.height = 200+'px'; }else if(iWSon<1300){ oSubbanner.style.height = iWSon * (200/1300)+'px'; } } } //字号大小 function FontSize2(Size,obj){ var iNum = 16; $(Size).find('.max').bind('click',function (){ iNum+=2; if(iNum>=24){ iNum = 24; } $(obj).css('font-size',iNum + 'px'); return iNum; }) $(Size).find('.mid').bind('click',function (){ iNum = 17; $(obj).css('font-size',iNum + 'px'); return iNum; }) $(Size).find('.min').bind('click',function (){ iNum-=2; if(iNum<=16){ iNum = 14; } $(obj).css('font-size',iNum + 'px'); return iNum; }) }; //大图切换高度问题 function ImgHeight(){ //var oSlider = document.getElementById('slider'); // var aLiSlider = oSlider.getElementsByTagName('img'); function ImgHeight02(){ var iWSon = document.documentElement.clientWidth; if(iWSon>=1178){ $('.slides').css('height', 380+'px'); //$(".slides").css("padding-bottom", 380+'px'); }else if(iWSon>800){ $('.slides').css('height',iWSon * (380/1178)+'px'); //$(".iosSliderDemo").css("padding-bottom", iWSon * (380/1178)+'px'); }else if(iWSon<=800){ $('.slides').css('height',iWSon * (246/780)+'px'); //$(".iosSliderDemo").css("padding-bottom", iWSon * (242/780)+'px'); } } ImgHeight02(); $(window).resize(function(){ ImgHeight02(); }) } //大图切换高度问题 function newsImgHeight(){ function newsImgHeight02(){ var iWSon = document.documentElement.clientWidth; if(iWSon>=1024){ $('.slides,.slides li').css('height', 371+'px'); //$(".iosSliderDemo").css("padding-bottom", 224+'px'); }else if(iWSon>=768) { $('.slides,.slides li').css('height',404+'px'); //$(".iosSliderDemo").css("padding-bottom", iWSon * (198/721)+'px'); }else{ $('.slides,.slides li').css('height',iWSon * (371/661)+'px'); } } newsImgHeight02(); } /*回到顶部*/ $(function(){ $(window).resize(function(){ var h = $(window).height(); $('.goTop').css('top',h-150); $(window).scroll(function(){ var scrollTop = $(document).scrollTop(); $('.goTop').stop().animate({ top: h + scrollTop-150 },300); }); //zTop(); liHide(); }).resize(); }); //gotop $('.goTop').click(function(){ $('body,html').stop().animate({scrollTop:0}); return false; }); $(function(){ $("#main li").mousemove(function(){ $(this).find('.til_slides').fadeIn(500); }) $("#main li").mouseleave(function(){ $(this).find('.til_slides').fadeOut(2000); }) }); function getCurrentDate() { var date = new Date(); var monthArray=new Array ("Jan.","Feb.","Mar.","Apr.","May.","June.","July.","Aug.", "Sept.","Oct.","Nov.","Dec."); var weekArray = new Array("Sunday","Monday","Tuesday", "Wednesday","Thursday","Friday","Saturday"); month=date.getMonth(); day=date.getDate(); if(day.toString().length == 1){ day="0"+day.toString(); } /*document.write(monthArray[month]+" "+day+", "+ date.getFullYear() + " " + weekArray[date.getDay()]);*/ $('.day').text(day); $('.month').text(monthArray[month]); $('.year').text(date.getFullYear()) } function tab(id){ var oTab = $(id); var oLi = oTab.find('ul').eq(0).find('li'); var oDd = oTab.find('dd'); var oMore = oTab.find('.tabMore span') oLi.hover(function(e) { var thisLi =$(this); //$(this).addClass('active').sibling('li').removeClass('active'); //setTimeout(function(){ thisLi.siblings('li').removeClass('active'); // 删除其他兄弟元素的样式 thisLi.addClass('active'); // 添加当前元素的样式 oDd.css('display','none'); oDd.eq(thisLi.index()).css('display','block').siblings().css('display','none'); oMore.css('display','none'); oMore.eq(thisLi.index()).css('display','block').siblings().css('display','none'); } //,100) //} ); } function subTab(id){ var oTab = $(id); var oLi = oTab.find('ul').eq(0).find('li'); var oDd = oTab.find('dd'); oLi.hover(function(e) { var thisLi =$(this); //$(this).addClass('active').sibling('li').removeClass('active'); //setTimeout(function(){ thisLi.siblings('li').removeClass('active'); // 删除其他兄弟元素的样式 thisLi.addClass('active'); // 添加当前元素的样式 oDd.css('display','none'); oDd.eq(thisLi.index()).css('display','block').siblings().css('display','none'); } //,100) //} ); } function liHide(){ var iWSon = document.documentElement.clientWidth; if(iWSon<1198){ $('.dd01').each(function(){ $(this).find('li').each(function(e){ if(e>=6){ $(this).remove() } }) }) } } function o2n(){ $('.dd01').each(function(){ $(this).find('li').each(function(e){ if(e%2==1){ $(this).addClass('floatR') } }) }) } function weixin01(){ $('.weixin01').hover(function(){ $('.codeWrap').show(); },function(){ $('.codeWrap').hide(); }) } function phoneWeixin(){ $('.weixin02').click(function(){ $('.lightbox_back').show(500); $('.lightbox_fore').show(500); $('body').css('overflow','hidden'); }) $('.boxClose').click(function(){ $(".lightbox_back").hide(500); $(".lightbox_fore").hide(500); $("body").css("overflow", "auto"); }) } //友情链接*相关链接 function location1(s) { var d = s.options[s.selectedIndex].value; window.open(d); s.selectedIndex=0; } function location2(s) { var d = s.options[s.selectedIndex].value; s.selectedIndex=0; window.top.location.href = d; } function liHide2(){ var iWSon = document.documentElement.clientWidth; if(iWSon<=768){ $('.news_rt').find('li').each(function(e){ if(e >= 6){ $(this).remove(); } }); $('.listRt').find('li').each(function(e){ if(e >= 4){ $(this).remove(); } }); $('.newsWidth').each(function(e){ $(this).find('li').each(function(e){ if(e >= 2){ $(this).remove(); } }) }) } } $(window).resize(function(){ liHide2(); }) function liHide3(){ var iWSon = document.documentElement.clientWidth; if(iWSon<=768){ $('.row01').find('li').each(function(e){ if(e >=4){ $(this).remove(); } }); $('.row02').find('li').each(function(e){ if(e >=4){ $(this).remove(); } }); $('.tabList04').find('dd').each(function(){ $(this).find('li').each(function(e){ if(e >=4){ $(this).remove(); } }) }); $('.recruit').find('li').each(function(e){ if(e >=4){ $(this).remove(); } }); } }