Community X.

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

3d ago

Collapse not working in live

Hi


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

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 = user.id; updatePage(); }); }); });

1

Hey,

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
.mp4
Download MP4 • 1.05MB

Editor X

Design your boldest creations.