Here is an illustrative demonstration, FIDDLE
<header>
<img src="http://precision-software.com/wp-content/uploads/2014/04/jQuery.gif" class="logo">
</header>
header {
background: violet;
position: fixed;
width: 100%;
height: 80px;
}
.logo {
margin: 10px 20px;
width: 60px;
height: 60px;
}
(function($) {
$(window).scroll(function() {
if($(this).scrollTop() > 0) {
$('header').stop().animate({ height: '50px' }, 400, 'linear');
$('.logo').stop().animate({ width: '30px', height: '30px' }, 400, 'linear');
}
else {
$('header').stop().animate({ height: '80px' }, 400, 'linear');
$('.logo').stop().animate({ width: '60px', height: '60px' }, 400, 'linear');
}
});
})(jQuery);