I have an issue with a scrolling header, it starts life at the bottom of the browser, once the page scrolls down and the header reaches the top, it fixes.
The issue is when it fixes, the following div will say jump the height of the header to the top.
Here's my jQuery
var elementPosition = $('header').offset();
$(window).scroll(function(){
if($(window).scrollTop() > elementPosition.top){
$('header').addClass("stick");
} else {
$('header').removeClass("stick");
}
});
and here's the css
.stick {
position:fixed;
top:0;
}