Tue Mar 22 2022 02:52:15 GMT+0000 (Coordinated Universal Time)
Saved by @25vitalyzd2
$(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"); } });
Copy this HTML code:
Preview:
open_in_newInstructions on embedding in Medium
Comments