Specific page code executed on other pages

I use the below Page code to collapse an element on specific pages. However, I have seen where the code passes over to other pages where I do not want the element collapsed.

Is this a known issue and/or is there something I can do to make sure it only executes on the pages I want it to?

$w.onReady(function () {
$w('#columnStrip35').collapse();
});

If you have put this code in your site tab then it will be applied to all of your site and happen on all pages.

If you have put it in your page tab, then it should only be occurring on the specific pages that you have used it on.

However, if you have also set the column strip to be shown on all pages, then it will be doing whatever your code states to do on all pages.

The other option would be to simply have that column strip on the specific pages that you don’t want it to be shown on set up in the properties panel for it to be collapsed on load.

That way it won’t be shown on those specific pages that you have it setup on and it won’t be taking up any space on your page.

If you do need it to appear on a particular page then you can simply use expand to bring it back again.

Thanks, GOS. I did have the code only in the Page tab of the pages I wanted it collapsed on. Note that this did not occur until the collapsed element page was visited. Then, the subsequent page where it should appear, it was still collapsed. I’ll try the collapsed properties panel setup.

Update: Still occurring. I unintentionally left out that this element is in my Footer, not in the Page. I’m wondering if then, the footer gets cached in its state and does not adhere to the ‘collapsed’ command?

If it is in your footer, then it will apply to all your pages.

You can try simply hiding your header and footer.
https://support.wix.com/en/article/corvid-tutorial-hiding-an-element-on-certain-pages

Or look at doing something like a frozen header.
https://www.wix.com/corvid/forum/corvid-tips-and-updates/fixed-frozen-header-example
https://www.wix.com/corvid/example/sticky-header

https://support.wix.com/en/article/about-the-footer
A footer appears across the bottom of your site, throughout all of your pages. The footer may contain your contact information, copyright information or your social media icons.

Right, I understand it applies to all pages, that’s actually why I placed it in the Footer. What I’m wondering is my the collapse in the Page Properties is not executed in the next page. Is it because the Footer is then always cached?

The reason I placed that element in the Footer is if I want to add it (Slideshow) to another page, I need to spend time edited to look correct. Maybe there’s a better solution to this?

Edit: I know it does execute, as when I refresh the page with the collapse property, the Element collapses.