maybe try:
$blackRows.each(function(){ var rect = this.getBoundingClientRect(); var style = this.currentStyle || window.getComputedStyle(this); var marginBottom = parseInt(style.marginBottom, 0) if(rect.top - offset < 0 && rect.bottom + marginBottom - offset > 0){ $nav.addClass("white"); jQuery(".sitetitle img").attr("src", "https://alicjaboss.com/wp-content/uploads/2022/06/logo_hell.png"); return false; }else{ $nav.removeClass("white"); jQuery(".sitetitle img").attr("src", "https://alicjaboss.com/wp-content/uploads/2022/06/logo_dark.png"); } });
A
alicja_b
@alicja_b