jquery - Change background-color while scrolling -


i background-color of header change background-color of div scrolls past. so, when scrolled div #about (green), background-color of header change green. have far, it's not working. appreciated.

var t = $('#about').offset().top - 100;  $(document).scroll(function(){     if($(this).scrolltop() > t)     {            $('header').css({"background-color":"green"});     }  }); 

check out fiddle.

your code works fine in fiddle after add jquery it. (i used 1.9.1).


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -