Scroll Menu Fixed WordPress ready
#masthead {
background: #fff;
&.fixed {
position: fixed;
top: 0;
width: 100%;
left: 0;
z-index: 10;
}
}
var menuPos = jQuery("#masthead").offset().top;
jQuery(window).scroll(function(event){
var y = jQuery(this).scrollTop();
var menuH = jQuery("#masthead").height();
if ( menuPos<=y){
jQuery("#masthead").addClass("fixed");
jQuery("#page").css("padding-top",menuH);
}
else {
jQuery("#masthead").removeClass("fixed");
jQuery("#page").css("padding-top",0);
}
});