There is the following code.
if ($(window).scrollTop(0)) { $('#console').css('background','blue'); } else { $(window).on('scroll',function(){ $('#console').css('background','red'); }); } When scrolling, the background should change, but when the scroll returns to the very top, the background should return.
He unfortunately is not working. How can I make a style change when scrolling? http://jsfiddle.net/FhRKU/39/