I'm trying to get the background-color of my fixed header to change upon scrolling over certain DIV sections on the page, similar to this:
The sections I'm using don't have a fixed height.
I've found this similar question Change background-color while scrolling
( which uses this fiddle http://jsfiddle.net/cEvJk/18/ )
var t = $('#about').offset().top - 100;
$(document).scroll(function(){
if($(this).scrollTop() > t)
{
$('header').css({"background-color":"green"});
}
});
But I'm unable to get the effect to repeat for all sections.