I have this code, but I not the best to javascript/jQuery so are there any out there who can optimize this code?
$(function(){
var pos = $("header").offset().top;
$(document).scroll(function(){
if($(this).scrollTop() - 10 > pos)
{
$('header').addClass("filled");
} else {
$('header').removeClass("filled");
}
});
});