So on my website I have a static header at the very top of the site -- it\'s not fixed to the top of the viewport. However, what I\'d like to do is once the user scrolls pas
I think that if you add the height of the div to the top offset you'll get the behaviour you want
$("#header-2").hide(); // hide the fixed navbar initially
var topofDiv = $("#header-container").offset().top; //gets offset of header
var height = $("#header-container").outerHeight(); //gets height of header
$(window).scroll(function(){
if($(window).scrollTop() > (topofDiv + height)){
$("#header-2").show();
}
else{
$("#header-2").hide();
}
});