-1
I’ve tried that code without succeeding.
$(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 I want to change color header
<header>
<div id=\"logo\">
......
......
</header>
But in your code you are applying the color to the body and not to the header
– Leo Letto