So I've been looking far and wide for ways to animate my header to change background color when I scroll further then 550px.
Here is the code:
$(function(){
$('header').data('size','big');
});
$(window).scroll(function(){
var $header = $('header');
if ($('body').scrollTop() > 550) {
if ($header.data('size') == 'big') {
$header.data('size','small').stop().animate({
'background','#444349'
}, 'slow');
}
} else {
if ($header.data('size') == 'small') {
$header.data('size','big').stop().animate({
'background','transparent'
}, 'slow');
}
}
});