Viewport Code Won’t Work on Every Page

I have the following code on the “masterPage.js” for my site so that it would function on all of my site pages. What it does is shrink my site’s menu in the header of the site as you scroll down. I have the “columnStrip22” shown on all pages, also ensuring that the code will function on every page. However, the code only works when you first load the site, and stops working once you go to another site page.

$w.onReady(function () {

    $w("#columnStrip22").onViewportLeave(() => {
        $w("#stripsmall").show();
        $w("#bigstrip").hide();
    })

    $w("#columnStrip22").onViewportEnter(() => {
        $w("#bigstrip").show();
        $w("#stripsmall").hide();
    })
});

Please let me know what the problem may be. Thanks for the help!

Can you try the Wix location module: path.onChanged() and re-register the event listeners?

Could you demonstrate how to achieve that? I implemented this code a while ago and have limited experience with Wix code

Hi, Sam! Did you get any solution to this? I’m stuck with the same problem.

Sadly, I’m still unsure what the fix entails

I checked, and it appears that Wix has fixed the issue!

Thanks for the update, Sam! Glad they fixed it!