// JavaScript Document $('#myModal').on('shown.bs.modal', function () { $('#myInput').focus() }); $('#myTabs a').click(function (e) { e.preventDefault() $(this).tab('show') }); $(document).ready(function(){ $(".subMenuContent").hide(); $(".subMenuTitle a").click(function(){ $(".subMenuTitle a").removeClass("sidebg"); $(this).addClass("sidebg"); $(this).parent().next().removeClass("menu-list"); $(".menu-list").slideUp(); $(this).parent().next().slideToggle(); $(this).parent().next().addClass("menu-list"); }); $(".leftWrapper").hover(function(){ $(".leftWrapper").stop().animate({width:"200px"},300); $(".mainWrapper").stop().animate({marginLeft:"215px",marginRight:"-200px"},300); $(".subMenuText").fadeIn(500); $(".logoInfo").show("fast"); },function(){ $(".leftWrapper").stop().animate({width:"56px"},300); $(".mainWrapper").stop().animate({marginLeft:"61px",marginRight:"15px",paddingRight:"0"},300); $(".subMenuText").fadeOut("fast"); $(".logoInfo").hide(); $(".subMenuContent").slideUp(); }); $(".logo").hover(function(){ $(".logoList").show(); },function(){ $(".logoList").hide(); }); $(".dropdown-toggleSF").click(function(){ $(this).next().toggle(); }); $(document).bind("click",function(e){ var target = $(e.target); if(target.closest(".dropdown-toggleSF,.dropdown-list li").length == 0){/*.closest()沿 DOM 树向上遍历,直到找到已应用选择器的一个匹配为止,返回包含零个或一个元素的 jQuery 对象。*/ $(".dropdown-list").hide(); }; e.stopPropagation(); }); });