@@ -77,6 +77,10 @@ $(function() {
$('.parent').addClass(['z-30']);
}
});
+
+ if (distance === 0) {
+ $(window).off('scroll'); // Remove scroll event listener
+ }
// Initially check visibility on page load
$(window).trigger('scroll');