Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

active menu adminlte 3 using jquery

// 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');
 
PREVIOUS NEXT
Tagged: #active #menu #adminlte #jquery
ADD COMMENT
Topic
Name
6+4 =