Reputation: 1466
i just want to change the font color on hover when scrollTop() > 10
My CSS
.navbar-default .navbar-nav>li>a:hover, .navbar-default .navbar-nav>li>a:focus {
color:#fff;
}
.navbar-default.scrolled{
background-color: #1F1F1F;
}
i wanna make #10d9e4 this links color to be on hover when nav changes it's style
My JS
var a = $(".navbar-default").offset().top;
$(document).on('scroll', function() {
if ($(this).scrollTop() > 10) {
$('.navbar-default').addClass("scrolled");
} else {
$('.navbar-default').removeClass("scrolled");
}
});
Upvotes: 0
Views: 1225
Reputation: 193291
Add rule for hover when .navbar-default
has class 'scrolled', it will redefine default #fff
color:
.navbar-default.scrolled .navbar-nav > li > a:hover {
color: #10d9e4;
}
Upvotes: 1