I have tried this code without success.
$(document).ready(function(){
$(document).scroll(function() {
var alpha = Math.min(0.5 + 0.4 * $(this).scrollTop() / 210, 0.9);
var channel = Math.round(alpha * 255);
$(\"body\").css('background-color', 'rgb(' + channel + ',' + channel + ',' + channel + ')');
});
});
My codes
CSS
header {
background-color: #0683c9;
}
Element that I want to change the color header
<header>
<div id=\"logo\">
......
......
</header>