Hello,
I followed steps in the Wix Code video to change a header as the user scrolls, but it is not working.
Here is my header code:
export function header1_viewportLeave(event, $w) {
$w('whiteHeader').show();
//Add your code for this event here:
}
export function header1_viewportEnter(event) {
$w('whiteHeader').hide();
//Add your code for this event here:
}
I am receiving the error, "whiteHeader is not a valid selector".
Here are screenshots of the 2 strip's properties panels:
![](https://static.wixstatic.com/media/a27d24_65fb394053d24050b5f0ba6f3ad11d50~mv2.png/v1/fill/w_255,h_340,al_c,q_85,enc_auto/a27d24_65fb394053d24050b5f0ba6f3ad11d50~mv2.png)
![](https://static.wixstatic.com/media/a27d24_b1ba5ae0d08b4632a107f8ec81740f19~mv2.png/v1/fill/w_245,h_340,al_c,q_85,enc_auto/a27d24_b1ba5ae0d08b4632a107f8ec81740f19~mv2.png)
Thanks!
https://www.youtube.com/watch?v=6zS0OavqbAc&t=471s
https://russian-dima.wixsite.com/meinewebsite/reading-position
Perhaps this will help you.
EDIT: And here one more đ
https://www.youtube.com/watch?v=X0MpM3Ljt1I
Hi Josh,
The error is letting you know the element has not been selected properly. You're missing the # within the parenthesis inside your function. A valid selector should like this:
export function header1_viewportLeave(event, $w) { $w('#whiteHeader').show(); }
Check out this article for more info.
Hope this helps!
Good luck!