Most threads I see about shrinking the header when scrolling involves using jQuery animation or something similar. This makes it too obvious and instant, but I'm looking for something gradual:
http://www.kriesi.at/themes/enfold/
This is a good example of it and I'm trying to make something similar:
jQuery(document).ready(function($){
var $myDiv = $('#logo img');
var logoHeight = $myDiv.height;
var stop = false;
$(window).scroll(function() {
logoHeight = $myDiv.height;
var st = $(this).scrollTop();
if(st >= 50 || logoHeight >= 97){
stop = true;
}
if(!stop){
$myDiv.height(st);
}
}).scroll();
});
Using this jQuery keeping track of scrolling. The problem it that it never stops or just doesn't show up at all. Is there a better method to achieve what I mean?