Working on preview mode but no when it is published

Hello everyone, I’m having some issues with the header of my page.

I’ve followed all the steps of the video tutorial https://www.youtube.com/watch?v=ri98D-oZJnw

But for some reason it word on the preview mode, but dosen’t when it’s published.

The code that I used:

export function header1_viewportLeave(event) {
$w(‘#colorheader’).show();
//Add your code for this event here:
}

export function header1_viewportEnter(event) {
$w(‘#colorheader’).hide();
//Add your code for this event here:
}

Link to the page published: https://nicolycaneira.wixsite.com/website-1

Thanks for the help.

https://www.wix.com/corvid/forum/community-discussion/fixed-frozen-header-example