How can I stop pinned container box from scrolling over footer?

Hello everyone,
I want to put a pinned container box (to hold an offer) on a bunch of my pages but I can’t seem to make it dissapear when it reaches the footer. Right now it goes over the footer and that obviously doesn’t work. Here’s a link:
https://nikolaynkv.wixsite.com/mysite-1/ekskurzii

I tried using this code I found on another question, but I can’t make it work. I did it through the properties menu with viewport enter and leave, but still doesn’t work.

$w("#footer1").onViewportEnter((event) => {
    $w("#contactForm").collapse();//use the form property id
})
$w("#footer1").onViewportLeave((event) => {
    $w("#contactForm").expand();
})

Any help would be greatly appreaciated.
Thank you!

Nevermind, I got it to work by using viewportenter and viewportleave on the strips in my footer, opposed to the footer itself.

In case someone else needs it :

export function columnStrip15_viewportEnter(event) {
$w("#offerBox1").collapse();//use the box property id
}
export function columnStrip15_viewportLeave(event) {
$w("#offerBox1").expand();
}

Hey! I just found this .
how do you input this code? sorry - newbie to this stuff!

Hi, you have to activate Dev Mode from the top left, then a window that allows you to type in code will pop up.

Then select the strip you want to affect and use the OnViewPointEnter and OnViewPointLeave event handlers you will find on the bottom right.