在这里,我将单击“链接”时的导航栏背景颜色从白色更改为黑色,我需要在下拉列表不打开时导航栏应恢复为白色。
// Navigation dropdown start
$(".navbar-header .dropdown .nav-link").click(function(e){
$(this).closest(".navbar-header").addClass("navbar-selected");
});
$(document).click(function(event){
$(".navbar-header").removeClass("navbar-selected");
});
// Navigation dropdown end