Open next lightbox before closing current lightbox

I have a series of lightboxes which I have linked i.e. user clicks a button on lightbox1 which opens lightbox2. I want the lightbox2 to open without a delay between it opening and lightbox1 closing. Is there any way to achieve this or any workaround which would achieved the same outcome?

You can simply add code to your button so that the lightbox2 is opened and then lightbox 1 is closed, instead of simply having the lightbox 1 close and then the lightbox 2 open.
https://www.wix.com/corvid/reference/wix-window.lightbox.html#close
https://www.wix.com/corvid/reference/wix-window.html#openLightbox

Although the difference in time between one lightbox closing and another one opening is minimal for myself, so I would just stick with the common practice of closing the one and opening the other one automatically through the buttons onClick event handler function.

So instead of something like this…

export function Button_click(event) { 
wixWindow.lightbox.close();
wixWindow.openLightbox("Lightbox2");
}

to something like this

export function Button_click(event) {
wixWindow.openLightbox("Lightbox2");
wixWindow.lightbox.close("Lightbox1");
}

Although, depending on what you are doing with your website, you might be better off with a multistage form like this.
https://www.wix.com/corvid/example/multistage-form