$(document).ready(function() { window.addEventListener('resize', Rem, false); Rem(); }); function autoh(){ var ath=$('.autoh').height(); $('.autohh').css({'height':ath-20+'px'}); } function autoimg_list(){ var wit=$('.imgautolist li img').width(); var cplbinfo_h=$(".imgautolist li .cplbinfo").height(); var nnh = cplbinfo_h + wit; $('.imgautolist').find("li .imgbox").css({'height':wit+'px'}); // $('.imgautolist').find("li").css({'height':nnh+20+'px'}); // $('.imgautolist').find("li a").css({'height':nnh-1+'px'}); } function Rem() { var docEl = document.documentElement, oSize = docEl.clientWidth / 19.2; if (oSize > 100) { oSize = 100; // 闄愬埗rem鍊 640 / 6.4 =100 } docEl.style.fontSize = oSize + 'px'; } /*jq妯℃嫙涓嬫媺鑿滃崟鍒嗙被鎼滅储*/ function serchboxmenu() { $(".top_serch dt").click(function() { $(".top_serch dd").toggle(); }); $(".top_serch dd ul li").click(function() { var text = $(this).text(); $("#btn").val(text); $(".top_serch dd").hide(); }); $(".top_serch dd .hiden span").click(function() { $(".box-ct").hide(); }); } //妯℃嫙涓嬫媺鑿滃崟鍒嗙被鎼滅储end /*婊戝潡*/ function setTab(name,cursel,n){ for(i=1;i<=n;i++){ var menu=document.getElementById(name+i); var con=document.getElementById("con_"+name+"_"+i); menu.className=i==cursel?"hover":""; con.style.display=i==cursel?"block":"none"; } } /*婊戝潡 end*/ /**淇℃伅鍒嗙被*/ function showSubMenu() { $(".mddaa").mouseover(function() { $("#newSubMenu").toggle(); }); $(".newSubMenu").mouseleave(function() { $("#newSubMenu").hide(); }) //榧犳爣婊戣繃鏄剧ず 绛涢€夋鏁堟灉 $("#newSubMenu").mouseover(function() { $(".newMenuBlock").mouseover(function() { $(this).find(".newSubMenuCon").show(); $(this).find("h3").addClass("currentLink"); }) }) $(".newMenuBlock").mouseleave(function() { $(this).find(".newSubMenuCon").hide(); $(this).find("h3").removeClass("currentLink"); }) } /**淇℃伅鍒嗙被 end*/ /*閫氬睆鍥剧墖鍒囨崲*///8涓灏戞椂鏀瑰嚭鏉ョ殑JS鐝嶈棌鍟婏紝姣旇捣鍏朵粬澶х綉绔欎笂鐨勫鏄擄紝绠€鍗曞浜嗭紙2012-5-9 23:31锛夛紝鎶勮€呰鍠勫緟姝や唬鐮 function showPicsBox(){ var sWidth = $("#housebox ul").width(); //鑾峰彇鐒︾偣鍥剧殑瀹藉害锛堟樉绀洪潰绉級 var len = $("#housebox ul").length; //鑾峰彇鐒︾偣鍥句釜鏁 var index = 0; var picTimer; //浠ヤ笅浠g爜娣诲姞鏁板瓧鎸夐挳鍜屾寜閽悗鐨勫崐閫忔槑鏉★紝杩樻湁涓婁竴椤点€佷笅涓€椤典袱涓寜閽 var btn = "
"; for(var i=0; i < len; i++) { btn += ""; } btn += "
"; $("#housebox_click").append(btn); //涓哄皬鎸夐挳娣诲姞榧犳爣婊戝叆浜嬩欢锛屼互鏄剧ず鐩稿簲鐨勫唴瀹 $("#housebox_click .btn span").mouseenter(function() { index = $("#housebox_click .btn span").index(this); showPics(index); }).eq(0).trigger("mouseenter"); //涓婁竴椤点€佷笅涓€椤垫寜閽€忔槑搴﹀鐞 鏈珯姝ゅ姛鑳界暐浜?鈥斺€? /*$("#housebox .preNext").css("opacity",0.2).hover(function() { $(this).stop(true,false).animate({"opacity":"0.5"},300); },function() { $(this).stop(true,false).animate({"opacity":"0.2"},300); });*/ //涓婁竴椤垫寜閽 $("#housebox .pre").click(function() { index -= 1; if(index == -1) {index = len - 1;} showPics(index); }); //涓嬩竴椤垫寜閽 $("#housebox .next").click(function() { index += 1; if(index == len) {index = 0;} showPics(index); }); //鏈緥涓哄乏鍙虫粴鍔紝鍗虫墍鏈塴i鍏冪礌閮芥槸鍦ㄥ悓涓€鎺掑悜宸︽诞鍔紝鎵€浠ヨ繖閲岄渶瑕佽绠楀嚭澶栧洿ul鍏冪礌鐨勫搴 $("#foucsbox").css("width",sWidth * (len)); //榧犳爣婊戜笂鐒︾偣鍥炬椂鍋滄鑷姩鎾斁锛屾粦鍑烘椂寮€濮嬭嚜鍔ㄦ挱鏀 $("#housebox").hover(function() { clearInterval(picTimer); },function() { picTimer = setInterval(function() { showPics(index); index++; if(index == len) {index = 0;} },4000); //姝?000浠h〃鑷姩鎾斁鐨勯棿闅旓紝鍗曚綅锛氭绉 }).trigger("mouseleave"); //榧犳爣缁忚繃li鍏冪礌鐗规晥 $(".interest-list li").hover(function(){ $(this).css({"background":"#F6F6F6"},600); $(this).addClass("quan2",600); }).mouseleave(function(){ $(this).css({"background":"#fff"},600); $(this).removeClass("quan2") }) //杩樻宸ュ叿 $(".tools li img").css({"opacity":"0.88"}).hover(function(){ $(this).css({"opacity":"1"},300) }).mouseleave(function(){ $(this).css({"opacity":"0.88"},300); }) //鏄剧ず鍥剧墖鍑芥暟锛屾牴鎹帴鏀剁殑index鍊兼樉绀虹浉搴旂殑鍐呭 function showPics(index) { //鏅€氬垏鎹 var nowLeft = -index*sWidth; //鏍规嵁index鍊艰绠梪l鍏冪礌鐨刲eft鍊 $("#housebox ul").stop(true,false).animate({"left":nowLeft},600); //閫氳繃animate()璋冩暣ul鍏冪礌婊氬姩鍒拌绠楀嚭鐨刾osition $("#housebox_click .btn span").removeClass("current").eq(index).addClass("current"); //涓哄綋鍓嶇殑鎸夐挳鍒囨崲鍒伴€変腑鐨勬晥鏋 $("#housebox_click .btn span").stop(true,false).animate({"opacity":"0.6"},300).eq(index).stop(true,false).animate({"opacity":"1"},300); //涓哄綋鍓嶇殑鎸夐挳鍒囨崲鍒伴€変腑鐨勬晥鏋 } }; //鍒楄〃鎺掑簭鏂瑰紡 function serxboxdownc(){ $(".serxboxdown dt").click(function() { $(".serxboxdown dd").toggle(); }); $(".serxboxdown dd ul li").click(function() { var texto = $(this).text(); $(".serchlox").val(texto); $(".serxboxdown dd").hide(); }); $(".serxboxdown dd .hiden span").click(function() { $(".box-ct").hide(); }); /*jq鍒楄〃鎺掑簭鏂瑰紡 end*/ /*lieb*/ } //鏍忕洰鎼滅储绛涢€ function quyu_boxbb(){ $(".serbox_bb dl dd a").click( function(){ $(this).addClass("Oncolor") } ) $(".quyu_boxbb a").click( function(){ $(".xiangxiqu").show(); } ) } //鎼滅储鍒楄〃 灞曞紑 鍏抽棴 function showserbox(){ $("#selectbar span[name=cateswitch]").each(function(){ $(this).toggle(function(){ $(this).removeClass('b1').addClass('b2').text('鏀惰捣').prev('.serchlv_list').children().slice(5).show(); },function(){ $(this).removeClass('b2').addClass('b1').text('灞曞紑').prev('.serchlv_list').children().slice(5).hide(); }); }); } //鎼滅储鍒楄〃 灞曞紑 鍏抽棴 end //鍒濆璇濇悳绱㈠€ function serch_click(){ var setx = $(".serchl"); //鑾峰彇鏂囨湰妗嗗璞 setx.click(function() { setx.val(""); setx.css({ color: "#000" }) }) } /*鍒濆璇濇悳绱㈠€ end*/ $(function(){ //涓嬫媺鑿滃崟 $('li.mainlevel').mousemove(function(){ $(this).find('.lbul').slideDown(); $(this).addClass("hover") }); $('li.mainlevel').mouseleave(function(){ $(this).find('.lbul').slideUp() $(this).removeClass("hover") }); }); //涓嬫媺鑿滃崟end //榧犳爣缁忚繃澧炲姞鏍峰紡 function yxbox(){ $('.yxbox_m').mousemove(function(){ $(this).children(".xqo").css({"display":"block"},600) }) .mouseleave(function(){ $(this).children(".xqo").css({"display":"none"},600) }) } //涓夌骇鍒嗙被 function menu_sanji(){ $(".on_clickm").click(function() { $(this).next("div").slideToggle("slow").siblings(".show_box:visible").slideUp("slow"); $(this).toggleClass("activeTitle"); $(this).siblings(".activeTitle").removeClass("activeTitle"); }); } //涓夌骇鍒嗙被 end // 閫夐」鍗 var modTab = { init : function(set){ var index = 0; var defaultSet = { event : 'click', // click,mouseover change : $.noop() }; var set = $.extend(defaultSet,set); set.root.find('.mod-tab-title li').each(function(){ if($(this).hasClass('cur')){ index = $(this).index(); } }); set.root.find('.mod-tab-main .tab-content').eq(index).show().siblings().hide(); set.root.find('.mod-tab-title li').on(set.event,function(){ index = $(this).index(); $(this).addClass('cur').siblings().removeClass('cur'); set.root.find('.mod-tab-main .tab-content').eq(index).show().siblings().hide(); }) } } // 鑷畾涔変笅鎷夊垪琛 $(function(){ $('.select').data({isShow:false}); $('.select').click(function(e){ $(this).data('isShow') ? $(this).children('ul').hide() : $(this).children('ul').show(); $(this).data({isShow:!$(this).data('isShow')}); if(e.target.tagName == 'LI'){ var text = $(e.target).html(); // 鏂囨湰鍐呭 var value = $(e.target).attr('rel'); // 瀛樺偍鐨勫€ $(this).data({value:value}); $(this).children('.show').html(text); } e.stopPropagation(); }); $(document).click(function(){ $('.select').each(function(index, element) { if($(this).data('isShow')){ $(this).children('ul').hide(); $(this).data({isShow : false}) } }); }); // 閫夐」鍗 modTab.init({ root:$('.lbTab') }); // 閫夐」鍗 modTab.init({ root:$('.edTab') }); // 閫夐」鍗 modTab.init({ root:$('.community .reg') }); $.accordion({ root : $('.accordion') }); //棣栭〉鎵嬮鐞存晥鏋 }); $.extend({ accordion : function(set){ var root = set.root; root.children('.picture').eq(0).css({width:267}).next('.content').css({width:306}); root.children('.picture').eq(0).children('.name').css({display:'none'}); root.children('.picture').eq(0).children('.nameBox').css({display:'none'}); var tmout=null; root.children('.picture').hover(function(){ var obj=$(this); clearTimeout(tmout); tmout=setTimeout( function() { if(obj.children('.name').width() == 103){ obj.children('.name').fadeOut().parent().siblings().children('.name').fadeIn(); obj.children('.nameBox').fadeOut().parent().siblings().children('.nameBox').fadeIn();; } obj.animate({width:267}).siblings('.picture').animate({width:103},'easeInOutSine'); obj.next('.content').animate({width:306},'easeInOutSine').siblings('.content').animate({width:0}); },200 ); },function(){ }); } }); jQuery(function(){ $('.fdNavList').hover( function(){ $(this).addClass('fdNavListBg'); $(this).animate({width:"650px"},1); }, function(){ //var oLi = $(this); setTimeout(function(){oLi.removeClass('fdNavListBg')},380); $(this).removeClass('fdNavListBg') $(this).animate({width:"244px"},1); } ) $('.fdNavListA1').hover( function(){ $(this).addClass('fdNavListBg'); $(this).animate({width:"330px"},1); }, function(){ $(this).removeClass('fdNavListBg') $(this).animate({width:"244px"},1); } ) setInterval( function(){$('.navBox_red .navJtBox').find('img').animate({bottom:'30px'})} ,1000);//1000涓?绉掗挓 setInterval( function(){$('.navBox_red .navJtBox').find('img').animate({bottom:'14px'})} ,1000);//1000涓?绉掗挓 $('.navBoxPr').hover( function(){$(this).find('.fdNavpa').show()},function(){$(this).find('.fdNavpa').hide()} ) }); //杩斿洖椤堕儴 $.fn.returnTop = $.fn.returntop = function(options){ var _this = this; var setting = { hide : true, // 褰搒rollTop涓?,椤甸潰澶勪簬鏈€椤剁鐨勬椂鍊欙紝闅愯棌杩斿洖椤堕儴鎸夐挳 false || true speed : 600, // 杩斿洖椤堕儴婊氬姩鎵€闇€瑕佺殑鏃堕棿 callback : $.noop //鍒拌揪椤堕儴鍚庣殑鍥炶皟鍑芥暟 }; if(options){ $.extend(setting,options); } this.click(function(){ $('html, body').animate({scrollTop: 0},setting.speed,function(){ setting.callback.call(this); }); }); if(setting.hide){ $(document).scrollTop() > 0 ? _this.show() : _this.hide(); $(window).bind("scroll", function() { $(document).scrollTop() > 0 ? _this.fadeIn() : _this.fadeOut(); }); } }; /*甯歌闂*/ $(document).ready(function() { $(".question1 dl,.Recruitment3 dl").eq(0).find("dd").show(); $(".question1 dl dt,.Recruitment3 dl dt").click(function(){ $(this).addClass("cur").parent().siblings().find("dt").removeClass("cur"); $(this).next().slideDown().parent().siblings().find("dd").slideUp(); }) });