Topic: SideNav keep selected item highlighted
garrithsteyn pro asked 8 years ago
Marta Szymanska staff pro premium answered 7 years ago
.current-menu-item {
background: #33b5e5;
}
Jquery:
$(document).ready(function () {
$('.side-nav .collapsible li .collapsible-body ul li').click(function(e) {
$('.side-nav .collapsible li .collapsible-body ul li.current-menu-item').removeClass('current-menu-item')
$(this).closest('li').addClass('current-menu-item');
});
});
Best,
Marta Marta Szymanska staff pro premium answered 8 years ago
.active
like here:
<li><a class="collapsible-header waves-effect arrow-r active"><i class="fa fa-home"></i> Homepages<i class="fa fa-angle-down rotate-icon"></i></a>
<div class="collapsible-body">
<ul>
<li><a href="" class="waves-effect active">Default Homepage</a>
</li>
<li><a href="" class="waves-effect">Full Width Homepage</a>
</li>
Best,
Marta Adam Adamczyk commented 7 years ago
With the latest version active class on item level seems to be not working - at least I do not see any difference.Marta Szymanska staff pro premium commented 7 years ago
Hi, so how would you like this to look like? Best, Martamdbpenguinglu pro answered 7 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No