global.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // JavaScript Document
  2. $('#myModal').on('shown.bs.modal', function () {
  3. $('#myInput').focus()
  4. });
  5. $('#myTabs a').click(function (e) {
  6. e.preventDefault()
  7. $(this).tab('show')
  8. });
  9. $(document).ready(function(){
  10. $(".subMenuContent").hide();
  11. $(".subMenuTitle a").click(function(){
  12. $(".subMenuTitle a").removeClass("sidebg");
  13. $(this).addClass("sidebg");
  14. $(this).parent().next().removeClass("menu-list");
  15. $(".menu-list").slideUp();
  16. $(this).parent().next().slideToggle();
  17. $(this).parent().next().addClass("menu-list");
  18. });
  19. $(".leftWrapper").hover(function(){
  20. $(".leftWrapper").stop().animate({width:"200px"},300);
  21. $(".mainWrapper").stop().animate({marginLeft:"215px",marginRight:"-200px"},300);
  22. $(".subMenuText").fadeIn(500);
  23. $(".logoInfo").show("fast");
  24. },function(){
  25. $(".leftWrapper").stop().animate({width:"56px"},300);
  26. $(".mainWrapper").stop().animate({marginLeft:"61px",marginRight:"15px",paddingRight:"0"},300);
  27. $(".subMenuText").fadeOut("fast");
  28. $(".logoInfo").hide();
  29. $(".subMenuContent").slideUp();
  30. });
  31. $(".logo").hover(function(){
  32. $(".logoList").show();
  33. },function(){
  34. $(".logoList").hide();
  35. });
  36. $(".dropdown-toggleSF").click(function(){
  37. $(this).next().toggle();
  38. });
  39. $(document).bind("click",function(e){
  40. var target = $(e.target);
  41. if(target.closest(".dropdown-toggleSF,.dropdown-list li").length == 0){/*.closest()沿 DOM 树向上遍历,直到找到已应用选择器的一个匹配为止,返回包含零个或一个元素的 jQuery 对象。*/
  42. $(".dropdown-list").hide();
  43. };
  44. e.stopPropagation();
  45. });
  46. });