📜  使用 jquery 的活动菜单 adminlte 3 - Javascript 代码示例

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

代码示例1
// AdminLTe 3.0.x
/** 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');