Lightbox opens when user leaves a certain page

Is it possible, through Wix Code, to have a lightbox open when the user leaves a page? Essentially, I want the lightbox to say if the user wants to save the form as a draft or discard the draft and then continue to where the user clicked.

You can open a lighbox using the openLightbox function. However, note that you need to call this function for each “leaving a page” scenario (clicking on a certain button for example).

Good luck,

1 Like