quick question about the the animate property in jquery, Is it possible to animate
I cant figure out how? here is my html
Here you go, it was your line-height in animate function it should have been 'line-height'
$(function(){
$('nav').data('size','big');
});
$(window).scroll(function(){
var $nav = $('nav');
var $a = $('nav > a');
if ($('body').scrollTop() > 0) {
if ($nav.data('size') == 'big') {
$nav.data('size','small').stop().animate({
height:'40px',
'line-height':'40px'
}, 300);
$a.data('size','small').stop().animate({
height:'20px'
}, 300);
}
} else {
if ($nav.data('size') == 'small') {
$nav.data('size','big').stop().animate({
height:'100px',
'line-height':'40px'
}, 300);
$a.data('size','big').stop().animate({
height:'40px'
}, 300);
}
}
});