# Change Menu (nav) item color when scrolling

**URL:** <https://forum.wixstudio.com/t/change-menu-nav-item-color-when-scrolling/51962>\
**Category:** Ask the community\
**Tags:** wix-forum, code, design, question\
**Created:** [August 28, 2023, 2:29pm UTC](https://forum.wixstudio.com/t/change-menu-nav-item-color-when-scrolling/51962 "2023-08-28T14:29:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Woojin\_Choi](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/woojin_choi/32/81921_2.png) [@Woojin\_Choi](https://forum.wixstudio.com/u/Woojin_Choi)\
**Post date:** [August 28, 2023, 2:29pm UTC](https://forum.wixstudio.com/t/change-menu-nav-item-color-when-scrolling/51962/1 "2023-08-28T14:29:55Z")

</div>

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?
