删除AdminLTE仪表板Active类 [英] AdminLTE Dashboard Active class remove
本文介绍了删除AdminLTE仪表板Active类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用AdminLTE仪表板.在侧边栏的Treeview菜单中,单击菜单后删除活动类.
I'm using AdminLTE dashboard. In sidebar treeview menu active class remove after click on menu.
推荐答案
将此JavaScript添加到页脚
*这适用于管理侧边栏菜单以及侧边栏菜单树视图
*this works for adminlte sidebar menu and also for sidebar menu treeview
/** add active class and stay opened when selected */
var url = window.location;
// for sidebar menu entirely but not cover treeview
$('ul.sidebar-menu a').filter(function() {
return this.href == url;
}).parent().siblings().removeClass('active').end().addClass('active');
// for treeview
$('ul.treeview-menu a').filter(function() {
return this.href == url;
}).parentsUntil(".sidebar-menu > .treeview-menu").siblings().removeClass('active').end().addClass('active');
这篇关于删除AdminLTE仪表板Active类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文