DEMO
I have used an image at top instead of the "HEADER" mentioned in your question.
This is the js I have used to make the header(navbar in your case) fixed.
var stickyNavTop = $('#header').offset().top;
$(window).scroll(function() {
if ($(window).scrollTop() > stickyNavTop) {
$('#header').addClass('fixed');
}
else {
$('#header').removeClass('fixed');
}
});