国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.3KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  6. <title>侧边菜单</title>
  7. <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
  8. <link rel="stylesheet" href="../static/web/css/admin.css">
  9. <script src="../static/web/js/jquery.min.js"></script>
  10. </head>
  11. <body class="menu-box">
  12. <div class="menu-body">
  13. <ul id="menu" class="item-menu">
  14. <?php
  15. $openitem=100;
  16. GetMenus($cuserLogin->getUserRank(),'main');
  17. ?>
  18. </ul>
  19. </div>
  20. <script>
  21. $(function() {
  22. var menu = function(el, multiple) {
  23. this.el = el || {};
  24. this.multiple = multiple || false;
  25. var links = this.el.find('.link');
  26. links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown)
  27. }
  28. menu.prototype.dropdown = function(e) {
  29. var $el = e.data.el;
  30. $this = $(this),
  31. $next = $this.next();
  32. $next.slideToggle();
  33. $this.parent().toggleClass('open');
  34. if (!e.data.multiple) {
  35. $el.find('.submenu').not($next).slideUp().parent().removeClass('open');
  36. };
  37. }
  38. var menu = new menu($('#menu'), false);
  39. $(".submenu li a").click(function(e) {
  40. $(".submenu li").removeClass('active');
  41. $(this).parent().addClass('active');
  42. })
  43. });
  44. </script>
  45. </body>
  46. </html>