Hello! Please help me create following tasks in corvid regarding lightbox: 1) When clicking the button on the home page, a lightbox pops up and shows the text from the homepage input element.
2) When the button in the lightbox is clicked, it returns the text from the lightbox input element.
Thank you so much! My main issue here is that I can’t figure out how to open a lightbox specifically after clicking a specific button. I insert the following code, but the lightbox keeps opening before I click on a button:
import wixWindow from 'wix-window';
wixWindow.openLightbox("LightboxName");
Do what Illia has stated above so that it doesn’t trigger on your page and use the code samples provided in the open lightbox reference to learn how to pass data to and from page and lightbox with openlightbox, getcontext, lightboxclose etc.
@givemeawhisky Many thanks for your help, my lightbox was indeed set to be automatically displayed, however, after I disabled this function it stopped appearing on the site at all after clicking on the button.
Just want to specify: does this code need to be added on the page of the Lightbox or no?
@olinse44 Thank Illia too please as he is the one giving you the code examples for you to copy and paste, I’m just giving you the links to do it all yourself.
As for passing data to and from page to lightbox and back again, if you get stuck anywhere then just come back and post your issues here.