I used the code to freeze the header of my website.
In the first instance, the header must be transparent and as soon as you scroll, the header turns white. This works in preview mode, but not in the live site. Can someone explain to me step by step what I did wrong? Preview mode:
You should really have your code setup so that the onViewportLeave event is called first and then the onViewportEnter after it, so basically the other way to how you have it set currently.
Also make sure that the onViewport functions must be applied to the ‘Header’ element itself and not any of your strips that you have made for the frozen header.
Plus, also make sure that you have the correct strip set as ‘Hidden on Load’ in the properties panel for it.
However, please note that this tutorial is supposedly not working with the code shown in the tutorial, although I would set it up via the tutorial first to see if it works for yourself.