I have a <div class="header"> which I want to be able to animate after the page has been scrolled 300px. I tried using the following script:
$(body).scroll( function() {
var value = $(this).scrollTop();
if ( value > 300 )
$(".header").css("height", "220px");
else
$(".header").css("height", "120px");
});
But nothing seems to be working...
The <div class="header"> is a fixed element at the top of the page, and I wonder if I can add more than one css argument, unlike $("div").css("one css-argument", "value")? (This has been solved)
Edit: I want the header to adjust it's height and font size when the page has been scrolled more than 300px.