Community X.

Connect with other creators, share ideas, give feedback and get the latest product updates.

Oct 18, 2020

Collapse not working in live


I'm trying to collapse a container on load using the .collapse() function within onReady(). It works fine in preview but not in the live site. Clicking the "Collapsed on load" button does work but I would have thought that it should also work via code.

Any thoughts? Thanks

2 answers1 reply
Oct 19, 2020

Can you share your code?

Oct 19, 2020

See below. The two .collapse() functions below work in preview but not live.

//-------------Imports-------------// import wixData from 'wix-data'; import wixUsers from 'wix-users'; import wixLocation from 'wix-location'; import wixWindow from 'wix-window'; //-------------Variables-------------// // Get the user ID which was created for the new member let userId; let user; $w.onReady(function () { //Don't show these section initially. $w("#moreInfo").collapse(); $w("#moreInfo2").collapse(); // Run the main function to update the page. $w("#dynamicDataset").onReady(() => { $w("#dataset1").onReady(() => { user = wixUsers.currentUser; userId =; updatePage(); }); }); });

Oct 20, 2020


Sorry for the late response.

I tried to perform the same operation and everything works properly.

Try creating new sections and Collapse them.

It is possible that something was destroyed in these Sections specifically.

Kapture 2020-10-20 at 19.16.15
Download MP4 • 1.05MB

Editor X

Design your boldest creations.