锘?(function () { var width; if (screen.width <= 1440) { width = $(".nav_ul").width() - 16; } else { width = $(".nav_ul").width() - 24; } var set_width; if (screen.width <= 1440) { set_width = 8; } else { set_width = 12; } //椤堕儴瀵艰埅鏍忎簩绾ц彍鍗曞竷灞€鍑芥暟 $(".nav_ul li").each(function () { var n = $(this).find("span"); if (n != null) { var y = n.innerWidth(); var x = $(this).position().left + set_width; if (y + x <= width) { n.css("left", x + "px"); } else { n.css("left", (width - y + set_width) + "px"); } } }); //宸︿晶鑿滃崟浜岀骇鐒︾偣浜嬩欢 $(".l_list_ul li dl dt").click(function (event) { $(this).addClass("curr").siblings().removeClass("curr"); }); $(".l_list_ul li").each(function () { if ($(this).hasClass("open")) $(this).find("dl").css("display", "block"); }); //宸︿晶鑿滃崟钃濇敹缂╁姩鐢诲寘鎷劍鐐逛簨浠 $(".l_list_ul li a").click(function () { var tem = $(this).next(); var par = $(this).parent(); par.addClass("curr").siblings().removeClass("open curr").siblings().find("dl").slideUp(300).removeClass("curr").find("dt").removeClass("curr"); if (tem.css("display") == "none") { tem.slideDown(300); par.addClass("open") } else { tem.slideUp(300); par.removeClass("open") } }); //椤堕儴瀵艰埅鏍忎簩绾ц彍鍗曞姩鐢诲垝鍏 $(".nav_ul li").mouseenter(function () { if (screen.width <= 1440) { $(this).find("span").css("visibility", "visible").stop().animate({ top: "80px" }, 200, "swing"); } else { $(this).find("span").css("visibility", "visible").stop().animate({ top: "110px" }, 200, "swing"); } }); $(".nav_ul li").mouseleave(function () { if (screen.width <= 1440) { $(this).find("span").css("visibility", "hidden").stop().animate({ top: "90px" }, 200, "swing"); } else { $(this).find("span").css("visibility", "hidden").stop().animate({ top: "120px" }, 200, "swing"); } }); //搴曢儴闆嗗洟鎴愬憳閾炬帴寮瑰嚭妗嗗垝鍏 $(".r_select>span").click(function () { if ($(".select_tip").css("visibility") == "hidden") { $(".select_tip").css("visibility", "visible").stop().animate({ bottom: "100%" }, 300, "swing"); } else { $(".select_tip").css({ "visibility": "hidden", "bottom": "150%" }); } }); //闆嗗洟鎴愬憳 $(".mem_downlist_grid").on("click", function () { $(".mem_downlist").toggleClass("hide"); }); //鐐瑰埌绌虹櫧澶勫垯鍏抽棴闆嗗洟鎴愬憳 $(document).click(function (e) { if ($(e.target).parents(".mem_downlist_grid").length == 0) { $(".mem_downlist").addClass("hide"); } }); });