Close a lighbox and return to show a button

Hey guys. I have a question…

I have this “info” button, when I click, it opens a lightbox and the “info” button disappear giving space to the lighbox information like this:

But when I close the lightbox, I cant make the “info” button show again:

Is there a way to reverse this effect back?

This is my code so far:

export function textinfo_click(event) {
wixWindow.openLightbox(“AboutOtoCozinha”);
$w(‘#textinfo’).hide();
}

I hide the info button, but I cant make it back when I close the Lightbox.

Thanks for the help!

You should just try adding that background to your lightbox. And try linking your text directly to the lightbox —- so no code is necessary.

But if you want to go the code way … check out the Wix docs for an example on how to receive a message from the lightbox to then do something on the page after the lightbox closes via code.

I must take the code way, because the background should be a slideshow or video… just duplicate the background will not work… :slight_smile:

I read about the open and close lightbox, but I cant figure out how to put this in my code… will try again…

Thank you!

I find a solution, posting in here just in case.

In the Project Code:

import wixWindow from ‘wix-window’;

// Hide/Show Info Button
$w(‘#textinfo’).onClick(async()=>{
$w(‘#textinfo’).hide();
const input = $w(‘#textinfo’);
const dataFromLightbox = await wixWindow.openLightbox(“AboutOtoCozinha”, input)
$w(‘#textinfo’);
$w(‘#textinfo’).show();
})

In the LightBox Code:

import wixWindow from ‘wix-window’;

// Hide/Show Info Button
let receivedData = wixWindow.lightbox.getContext();
$w(‘#infohidden’).text = receivedData;
$w(‘#infohidden’).hide();

wixWindow.lightbox.close(($w(‘#infohidden’)));
});

I don`t know if it is too much code, but if there is a way to resume it, just let me know!

Thanks for the help!