How to make white header background appear only on scroll?

Hey folks,

Hoping someone will be able to help me out. I used the below youtube video as a guide to get a white background on my header when you scroll down. My code doesn’t flag any errors, but the white element doesn’t appear when you scroll down. I’ve double checked and the names are all correct and using correct lowercase lettering.

www.youtube .com/watch?v=8iO0G_qWqRY

let fadeOptions = {
 "duration":   500,
 "delay":      0
};

export function header1_viewportLeave(event, $w) {
    $w('#headerwhite').show("fade",fadeOptions);
 //Add your code for this event here: 
}

export function header1_viewportEnter(event, $w) {
    $w('#headerwhite').hide("fade",fadeOptions);
 //Add your code for this event here: 
}

Hi,

I would like to take a deeper look into this. Please send us the link to your editor so I can investigate a bit more to see that you have everything set up correctly and run some tests.

Thank you, we await your reply.
Edward