Column Collapse/Expand Issue on Published Site

I have a trivial piece of code on a trivial page that works in Preview mode, but does not work once my page is published.

I have a Strip with two columns (column1 and column2).
I have a button (hideShow) with the code below tied to it (outside of the strip).

//----------------------------------------------
$w.onReady( function () {})

export function hideShow_click(event) {
if ($w(“#column1”).collapsed) {
$w(“#column1”).expand();
} else {
$w(“#column1”).collapse();
}
}
//----------------------------------------------

In Preview mode column1 collapses and expands as expected (with column2 expanding to fill the strip).

When I publish the page, column1 just “hides” and “shows” (that is it does not “collapse” and “expand”).

Any help would be most appreciated. (I have tried in both “stretch” and “page” modes for the strip…same behavior.)

Thanks in advance!
Jay

1 Like

Hello Jay,

Please check out this response here to a similar question:

Goodluck,
Majd

Majd,

Thank you for the reply, but your referenced post appears to relate to vertically stacked objects (on top of each other). The issue I am having is with collapsing/expanding a column in a 2-column strip. (horizontal).

If one of the columns is collapsed, the strip should turn into a 1-column strip that spans the page (horizontally).

It performs correctly in “Preview” mode, but does not perform this way on the “Published” site. It is like the “span” parameter is not being carried over to the “Published” site and the column that I try to collapse is just being “hidden” and not “collapsed”.

I have simplified my test to a single 2-column strip with only the one snippet of code (see above) on it to ensure that I am not missing anything.

I would be most appreciative is some has seen/solved this before.

Thanks again,
Jay

I’m having the exact same issue. Weird thing is that it was working initially but started all of a sudden as I started building up the page. I’ve tried creating a new page, with just the strip with columns, and am still running into the same issue. It’s frustrating because it works in preview mode. But not on the published site.

Hi Jay,
I started having similar problem yesterday. Have you found a solution?
Thanks,
Ofer

Hi Ofer,
Sorry to say…I could not get it to work and had to do pursue another avenue. I ended up using the slideshow feature to accomplish what I needed in a different design approach.
Jay

I am having the same issue but in the preview editor as well