//12.移动端顶部点击弹出下拉菜单 function Menu(menu,main){ var onOff = true; $(menu).bind('click',function (){ $(main).slideToggle(); if($(this).find('span').hasClass('fa-bars')){ $(this).find('span').removeClass('fa-bars'); $(this).find('span').addClass('fa-remove'); }else{ $(this).find('span').addClass('fa-bars'); $(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>=1920){ oSubbanner.style.height = 240+'px'; }else if(iWSon<1920){ oSubbanner.style.height = iWSon * (240/1920)+'px'; } window.onscroll = window.onresize = function (){ var iWSon = document.documentElement.clientWidth; if(iWSon>=1920){ oSubbanner.style.height = 240+'px'; }else if(iWSon<1920){ oSubbanner.style.height = iWSon * (240/1920)+'px'; } } } //大图切换高度问题 function ImgHeight(){ //var oSlider = document.getElementById('slider'); // var aLiSlider = oSlider.getElementsByTagName('img'); function ImgHeight02(){ var iWSon = document.documentElement.clientWidth; if(iWSon>=1920){ $('.Banner,.slides,.slides li').css('height', 560+'px'); //$(".iosSliderDemo").css("padding-bottom", 380+'px'); }else{ $('.Banner,.slides,.slides li').css('height',iWSon * (560/1920)+'px'); //$(".iosSliderDemo").css("padding-bottom", iWSon * (380/1178)+'px'); } } ImgHeight02(); $(window).resize(function(){ ImgHeight02(); }) } //大图切换高度问题 function newsImgHeight(){ function newsImgHeight02(){ var iWSon = document.documentElement.clientWidth; if(iWSon>=711){ $('.fluidHeight,.sliderContainer').css('height', 224+'px'); $(".iosSliderDemo").css("padding-bottom", 224+'px'); }else if(iWSon<=800){ $('.fluidHeight,.sliderContainer').css('height',iWSon * (198/721)+'px'); $(".iosSliderDemo").css("padding-bottom", iWSon * (198/721)+'px'); } } newsImgHeight02(); // $(window).resize(function(){ // newsImgHeight02(); // alert(3) // }) } /*回到顶部*/ $(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();//最新多余li隐藏 notice_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); //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 notice_liHide(){ var iWSon = document.documentElement.clientWidth; if(iWSon<=640){ $('.noticeList').find('li').each(function(e){ if(e>=4){ $(this).remove() } }) } } 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 divSelect(){ // 模拟下拉选择框 $('.select001').each(function(i,el){ var clickStatus = false; $(this).click(function(e){ //$(this).siblings().find('ul').slideUp(200) e.stopPropagation(); if(clickStatus == false){ $(this).children('ul').slideDown(200); clickStatus = true; } else { $(this).children('ul').slideUp(200); clickStatus = false; } }); $(this).attr({ 'd-value': $(this).find('.option_cur').text() }); $(this).find('.optionList li').each(function(i,el){ $(this).click(function(){ $(this).parent().parent().attr({ 'd-value': $(this).text() }).find('.option_cur span').text($(this).text()); }) }) }); var selectHeight = $('.select001 ul').each(function(){ var currentHeight = $(this).height(); if(currentHeight >= 290){ $(this).css('top',"-290px") $(this).height(290) }else{ $(this).css('top',-currentHeight+"px") } }) $(document).click(function(){ $('.select001 ul').slideUp(200); }); } divSelect();//调用下拉列表框 //友情链接*相关链接 /*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; } */