How to make animation when scrolling?

Need to fixed when scrolling Hadar changed color, when it starts a specific unit. How to do?
July 8th 19 at 16:28
1 answer
July 8th 19 at 16:30
$(window).scroll(function() {
if($(window).offset().top == %required% value) {
%change the color%
}
);

Find more questions by tags HTMLCSSjQueryAnimationJavaScript