header.active{
    background: #40305fad;
}

✅css
header에 activ 클래스가 추가되었을때 bakcground 색상을 다르게 설정

$(window).on('scroll',function(){
    if($(window).scrollTop()){
        $('header').addClass('active');
    }else{
        $('header').removeClass('active');
    }
});

✅jquery
1) 스크롤 함수
2) if scroll Top에서 움직이면 header에 active 클래스 추가
3) else active클래스 삭제

✔ addClass와 removeClass 다양하게 활용가능

+ Recent posts