I have a form and want to make sure it is only visible when the page has finished loading and users can interact with the first element (slider). So i tried the following:
However what I am experiencing (testing on throttled connection): #section0 is never visible to the eye #section1 becomes visible before the user can interact with the input elements, slider
the console log line (‘wix reay’) fires quite some time after #section1 becomes visible
I thought $w.onReady() was suposed to fire when all the elements finish loading, but it seems they cannot yet be interated with? Which event should I look for?
Every code should start with → $w.onReady() → this makes sure that your PAGE is ready to interact and to make sure you can use $W-elements on your page.
Why should $w ( ‘#section0’ ), be visible on the page, when you tell to → . collapse () it directly when page is ready for actions?
I thought $w.onReady() was suposed to fire when all the elements finish loading, but it seems they cannot yet be interated with? Which event should I look for?
Right you only can use elements safely when page has been loaded first…
…when page is – > READY …
all my code is wrapped within $w.onReady but what I am experiencing on slow connection that a slider and button are visible before $w.onReady is fired and I cannot yet interact with them.
I have just tested with published site, Chrome, no cache, network throttle set to slow 3g. No hidden sections anymore. All code wrapped in onReady()
Times are approx @0s page load @2s#btnContinue1 becomes visible, but click does not execute script (because onReady was not yet fired) @15s $w.onReady() event is fired (console log ‘wix ready’) @15s Button can be clicked