19 lines
449 B
JavaScript
19 lines
449 B
JavaScript
$('.navbar-nav li a').each(function () {
|
|
if ($($(this))[0].href == String(window.location)) {
|
|
$(this).parent().addClass('active');
|
|
}
|
|
else if (window.location.pathname == '/') {
|
|
$('.navbar-nav li').first().addClass('active');
|
|
}
|
|
else {
|
|
$('.navbar-nav li').first().removeClass('active');
|
|
}
|
|
|
|
});
|
|
|
|
|
|
// $(document).on('click', '.navbar-nav li', function () {
|
|
// $(".nav-list li").removeClass("active");
|
|
// $(this).addClass("active");
|
|
// });
|