Change Menu (nav) item color when scrolling

hi,

I currently have a transparent header on my pages and it turn white as I scroll down. (using basic wix design features)

Other than header background color, I want the menu “items” color to be changed.

I want it to start off as white and turn black as I scroll down a little bit.

I have searched wix forum a bit and I applied this code to master.js but seems not working.

export function anchor1_viewportEnter ( event ) {
$w ( “#horizontalMenu1 ). style . color = “rgba(255, 255, 255, 1.0)”
}

export function anchor1_viewportLeave ( event ) {
$w ( “#horizontalMenu1 ). style . color = “rgba(0, 0, 0, 1.0)”
}

I added an anchor and changed its id to “anchor1”, but it doesn’t seem to work out. menu items are still white from the start. can you help?

1 Like