.sticky {
position: fixed;
top: 0;
width: 100%;
}
/* ==========================================
scrollTop() >= 300
Should be equal the the height of the header
========================================== */
$(window).scroll(function(){
if ($(window).scrollTop() >= 300) {
$('nav').addClass('fixed');
$('nav div').addClass('visible-title');
}
else {
$('nav').removeClass('fixed');
$('nav div').removeClass('visible-title');
}
});