$(window).on("scroll", function() { if($(window).scrollTop() > 50) { $(".header").addClass("active"); } else { //remove the background property so it comes transparent again (defined in your css) $(".header").removeClass("active"); } });

Estimates

Estimates

  • NOTE: Please do not include filenames with special characters such as ' @ ! $ ( ) and others.