$(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"); } }); });