I'm trying to check if the div .full-screen doesn't exist on a page, is this the right way to do it?
if (!$(".full-screen").length) {
$(window).scroll(function() {
if ($(this).scrollTop() < 50) { // this refers to window
$(".header-container").addClass('transparent-menu');
} else {
$(".header-container").removeClass('transparent-menu');
}
});
}
The inner function runs regardless even though I know the class doesn't exist on the page.