Hello! I’m new to coding and am confused as to what’s wrong with the code I added.
I successfully created a sticky header that hides and gives way to a smaller, scrolling header. Now I want the scrolling header to hide when the footer enters. Here is my successful code for the header:
$w ( “#headertransitionpoint” ). onViewportLeave (() => {
$w ( “#defaultHeaderbar” ). hide ();
$w ( “#scrollingHeaderbar” ). show ();
})
$w ( “#headertransitionpoint” ). onViewportEnter (() => {
$w ( “#scrollingHeaderbar” ). hide ();
$w ( “#defaultHeaderbar” ). show ();
})
});
Here is the code I added to hide the scrolling header when footer enters:
$w ( "#footer1" ). onViewportLeave (() => {
$w ( "#scrollingHeaderstrip" ). show ();
})
$w ( “#footer1” ). onViewportEnter (() => {
$w ( “#scrollingHeaderstrip” ). hide ();
})
What is wrong with this? There seems to be no effect at all, but the code passed verification (Image attached.)
Any assistance would be greatly appreciated Toni