$(document).ready(function () { // 棣栭〉澶撮儴鎮诞鍥哄畾 if (window.location.pathname == '/') { var header = $("#header").offset().top; $(window).scroll(function () { var top = $(window).scrollTop(); if (top >= header) { $("#header").addClass("header_fixed"); } else { $("#header").removeClass("header_fixed"); } }); } $('.header').mouseenter(function (e) { $(this).addClass("over"); }); $('.header').mouseleave(function (e) { $(this).removeClass("over"); $('.nav_cont.on').removeClass('on'); $('.header .nav_list li.on').removeClass('on'); }); // 澶撮儴--nav 鏁堟灉 $('.header .nav_list li').mouseenter(function (e) { $(this).addClass("on").siblings().removeClass('on'); var index = $(this).index(); if ($(this).hasClass('no-expands')) { $('.nav_content .nav_cont').removeClass('on'); return; } $('.nav_content .nav_cont').removeClass('on'); $('.nav_content .nav_cont').eq(index).addClass('on'); }); // banner 杞挱鍥 bannerSlider(); // 鏂伴椈璧勮--杞挱鍥 newsSlider(); // 鏂伴椈璧勮--tab鍒囨崲 $(".news_tab li").click(function () { $(this).addClass('on').siblings().removeClass('on'); var index = $(this).index(); var content = '.news_con_con'; switch (index) { case 0: $(content).hide(); $(content + '01').show(); break; case 1: $(content).hide(); $(content + '02').show(); break; default: break; } }); // 鏂伴椈璧勮--鏂伴椈鍒掕繃鏁堟灉 var $newTanLi = $(".news_tab_list li"); $newTanLi.eq(0).addClass("active"); $newTanLi.eq(6).addClass("active"); if ($newTanLi.eq(0).hasClass("active")) { $newTanLi.eq(0).css("border-top", "0"); } if ($newTanLi.eq(6).hasClass("active")) { $newTanLi.eq(6).css("border-top", "0"); } $newTanLi.hover(function () { $(this).addClass("active").siblings().removeClass("active"); }); $(".list_con a").each(function () { var maxwidth = 80; if ($(this).text().length > maxwidth) { $(this).text($(this).text().substring(0, maxwidth)); $(this).html($(this).html() + '鈥?); } }); // 澶ф梾娓哥敓鎬 heartSlider(); //鐢ㄥ績闄潃浣 $(".ly_list01 li").eq(3).addClass("mar0"); $(".ly_list02 li").eq(2).addClass("mar0"); // 鏁板瓧涓潚鏃 $(".num_zqv_list li").eq(2).addClass("mar0"); $(".num_zqv_list li").eq(5).addClass("mar0"); // 鍏充簬鎴戜滑--鐐瑰嚮杩斿洖椤堕儴 goToTop(); $(window).scroll(function () { fixedGoToTopPos(); }); // 鍏充簬鎴戜滑--鑽h獕濂栭」 us_ryjx_tab(); $(".us_ryjx_tab_ul .us_ryjx_tab_li").click(function () { var index = $(this).index(); $(this).addClass("active").siblings().removeClass("active"); $(".us_ryjx_box .us_ryjx_list").eq(index).addClass("show").siblings().removeClass("show"); }); // 鏂伴椈璧勮--鏂伴椈鎶ラ亾 $('.news_search_box').click(function (event) { event.stopPropagation(); //$(this).addClass("on"); }); $(document).click(function (e) { if ($("#search").val() == "") { $('.news_search_box').removeClass("on"); $(".news_search_text").val(""); } }); $(".dtbd_tab li").click(function () { var index = $(this).index(); $(this).addClass('active').siblings().removeClass('active'); $(".dtbd_box .dtbd_list").eq(index).addClass("show").siblings().removeClass("show"); }); // 鏂伴椈璧勮--鏂伴椈鎶ラ亾--鍒楄〃鏁版嵁 getDataPro("news01", 1, 8, "", ""); getDataDq("dqjs_list_box", 1, 8) getDatacsr("shzr_list_box", 1, 6) getDatair("xxpl_list_box", 1, 8, "") getDatahr("recruit_list", 1, 8, "") // 鏂伴椈璧勮--鍥剧墖搴 $(".photos_tab li").click(function () { var index = $(this).index(); $(this).addClass('active').siblings().removeClass('active'); $(".photos_box .photos_list").eq(index).addClass("show").siblings().removeClass("show"); }); $(".photos_list_box .photos_list_li").click(function () { $("#alterDiv").empty(); $("#alterDivT").empty(); $("#alterDiv").attr("style", ""); $("#alterDivT").attr("style", ""); var divhtml = ""; var divt = ""; var info = JSON.parse($(this).attr("data-con")); $.each(info, function (e, ele) { if (e == "PvView") { $.each(ele, function (i, div) { divhtml += "
"; if (divt == "") { divt = "