📜  在 adminlte 3.0.2 树视图菜单中激活树视图菜单打开 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:18.245000             🧑  作者: Mango

代码示例1
/** add active class and stay opened when selected */
  var url = window.location;

// for sidebar menu entirely but not cover treeview
  $('ul.nav-sidebar a').filter(function() {
    return this.href == url;
  }).addClass('active');

// for treeview
  $('ul.nav-treeview a').filter(function() {
    return this.href == url;
  }).parentsUntil(".nav-sidebar > .nav-treeview").addClass('menu-open').prev('a').addClass('active');