Dynamic header not showing on live site

Hi!
I have two sites:
upvoicd.com
eartoear.io
I have the same Site Code running on both, designed to make the header shrink when you scroll down the page (code below).
These both work fine in Preview, and used to work in Live when I first added them.
However, more recently the header has stopped resizing in the Live version - even though it does still work in Preview. This occurs in both Chrome and Safari.

Can anyone tell me what the issue might be?

Many thanks!
Tom

$w.onReady(function () {
//TODO: write your page related code here…
});

export function header1_viewportLeave(event) {
$w(β€œ#logosmall”).show();
$w(β€œ#stripsmall”).show();
$w(β€œ#biglogo”).hide();
$w(β€œ#bigstrip”).hide();
}
export function header1_viewportEnter(event) {
$w(β€œ#logosmall”).hide();
$w(β€œ#stripsmall”).hide();
$w(β€œ#biglogo”).show();
$w(β€œ#bigstrip”).show();
}

1 Like

You’re right, this behavior has changed.
See here an example on how to implement this functionality: https://www.wix.com/corvid/example/Frozen-Header
Basically instead of using

header1_viewportEnter

you need to add an element under the header and add a viewportEnter function to it.

Brilliant - fixed now - THANK YOU !!

@ohad-laufer Any way you could pin a forum thread temporarily on this topic for the thousand and one people asking this same question? :slight_smile: