var shadeAmount = 161 / $('.header').length;
$('.header').each(function (i, e) {
var shade = i * shadeAmount;
var color = 'rgb(' + shade + ',' + shade + ',' + shade + ')';
$(this).css({"background-color": color});
});
I cannot get the above code to set the background-color property of each header. If I change the code to this:
$(this).css({"background-color": "rgb(1,1,1)"});
It works. So what's wrong with the way I'm declaring color?
"in$(this).css({"background-color": "rgb(1,1,1)});?console.log(color);