Hi!
I used the code I found in 2 older threads to make my navigation (site title + menu) change from black to white when it's over a black background (class id: blackrow), it was working for a while then I came back in the admin and updated and now it's not working.
Here is the code I am using:
Custom CSS:
/* Nav color change */
.blackrow {
background: #0e0e0e;
}
.white {
color: #f2f2f2;
}
Custom HTML at bottom:
<!--Nav color change-->
<script>
var offset = 50;
var $blackRows;
var $nav;
Frontend.GlobalEvents.on("newpageshown", function(layoutObj, type, obj){
$blackRows = jQuery(".blackrow");
$practice = jQuery(".info-centre-top");
$mobiletitle = jQuery(".mobile-title span");
$information = jQuery(".laynav span");
$nav = jQuery(".navbar");
$nav.removeClass("white");
$sitetitle = jQuery(".sitetitle span");
});
jQuery(document).on("scroll", function(){
$blackRows.each(function(){
var rect = this.getBoundingClientRect();
if(rect.top - offset < 0 && rect.bottom - offset > 0){
$sitetitle.addClass("white");
$mobiletitle.addClass("white");
$practice.addClass("white");
$information.addClass("white");
return false;
}else{
$sitetitle.removeClass("white");
$mobiletitle.removeClass("white");
$practice.removeClass("white");
$information.removeClass("white");
}
});
});
</script>
Does anyone know why it's not working anymore?
Thanks!