From the information provided on the website, you simply need to remove the .nav-dark
class from the div with the id of #masthead
when it is scrolled (or when the .stuck
class is added to the .header-wrapper
).
First, make sure to include jQuery:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Then you can use this jQuery script to achieve the desired effect:
function customizeHeader() {
var window_top = $(window).scrollTop();
if ($('.header-wrapper').hasClass('stuck')) {
$('#masthead').removeClass('nav-dark');
} else {
$('#masthead').addClass('nav-dark');
}
}
$(function() {
$(window).scroll(customizeHeader);
customizeHeader();
});
After implementing this, your result should look something like this:
https://i.sstatic.net/UuHmv.png
I hope this explanation helps you accomplish what you are aiming for!