Search
 
SCRIPT & CODE EXAMPLE
 

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');
Comment

active menu adminlte 3 using jquery


var url = window.location;
// for sidebar menu but not for treeview submenu
$('ul.sidebar-menu a').filter(function() {
    return this.href == url;
}).parent().siblings().removeClass('active').end().addClass('active');
// for treeview which is like a submenu
$('ul.treeview-menu a').filter(function() {
    return this.href == url;
}).parentsUntil(".sidebar-menu > .treeview-menu").siblings().removeClass('active menu-open').end().addClass('active menu-open');

Comment

PREVIOUS NEXT
Code Example
Javascript :: forcechange input reactiveform 
Javascript :: jquery grid disable sorting 
Javascript :: javascript capitalize first letter 
Javascript :: react native textinput lowercase 
Javascript :: javascript make beep sound 
Javascript :: js write to json file 
Javascript :: js console.log color reset 
Javascript :: express.json vs bodyparser.json 
Javascript :: javascript check empty object 
Javascript :: local storage check max size 
Javascript :: json file to object js 
Javascript :: how to append to file in js 
Javascript :: javascript react reverse map 
Javascript :: how to check if 2 sprites are touching js 
Javascript :: scrollview child layout ( justifycontent ) must be applied through the contentcontainerstyle prop 
Javascript :: Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. 
Javascript :: jquery set max attribute value 
Javascript :: jest expect href 
Javascript :: html-webpack-plugin npm 
Javascript :: generate random random number with fixed length 
Javascript :: javascript onkeyup multiple classes 
Javascript :: js add week to date 
Javascript :: loop n times js 
Javascript :: postman alternative 
Javascript :: css font size jsx 
Javascript :: sleep function javascript 
Javascript :: angular bootstrap not working 
Javascript :: in which language python is written 
Javascript :: how use for loop in append attribute in jquery 
Javascript :: remove attribute disabled javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =