<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
$(function () {
var menu = $("header");
$(window).scroll(function () {
var top = $(this).scrollTop();
if (top >= 100) {
menu.css('background', 'green');
} else if (top <= 200) {
menu.css('background', 'red');
}
});
});