How to change text color navigation when scroll page?

Hi there,

I have navigation and I want to change text color when scroll page.
Ex: normal navigation has text white color and when scroll page changes to text black color.
I had duplicate navigation and add ID for it. And add code in Site.
But error: “#navbarDark is not valid selector”,…

Please help me. Thanks!

Link demo: https://linhpeter0508.wixsite.com/kmsoft

Header action scroll:

Navigation error:

When page scrolled:

It looks like a wrong indication. I believe you can ignore it.

Yes as J.D. says, it all works fine on preview and live sites, it is just being shown as an error still in the Editor.

You can see an example of it with a header here.
https://www.wix.com/corvid/example/sticky-header

If you want to have it error free, then you put things in a strip and add this to your header, then you would use the strip to show and hide and you won’t get any errors on that.

You can also do similar with your header now without code too.
https://support.wix.com/en/article/changing-your-header-design

I have looked at 2 example links. But my code not working. As you can see in the 3rd figure example, text navigation is white color. I want to change to the black color.