This function is designed to check the opacity of the header, which fades out as a user scrolls down. If the opacity is less than 1, it disables clickability by adding the class "headerclickoff". However, there seems to be an issue with removing the class. Can anyone spot what might be wrong with my code?
function disableHeaderClick(){
var opacity = $("header").css("opacity");
if ( opacity <= 1) {
console.log("working");
$("header").addClass("headerclickoff");
} else {
$("header").removeClass("headerclickoff");
};
};