This is what I am trying to achieve:
I have done a lot of research on this but nothing helped. I have tried affix plugin and jQuery but found them to be very confusing. I am new to jQuery and find it a little difficult to understand and implement :(
Here you go:
$(window).scroll(function () {
if ($(window).scrollTop() >= 50) {
$('.navbar').css('background','red');
} else {
$('.navbar').css('background','transparent');
}
});