Exit intent pop-up in the classic/native editor not working

Hello
I want to implement an exit-intent pop-up in the Wix Classic Editor using a lightbox. I understand there are third-party apps I can use, but I prefer to use code customization, which is not working. I have tried the code below, but it only works in Wix Studio and not in the Classic/Native/Standard Editor.
Please let me know if it is possible to implement this using code, and if so, could you share the code I can use?
import wixWindowFrontend from ‘wix-window-frontend’;
import wixSiteFrontend from ‘wix-site-frontend’;

wixSiteFrontend.prefetchPageResources({
lightboxes: [‘Promo (30% off)’]
});

$w.onReady(function () {

$w('#page1').onMouseOut((event) => {

    if (event.clientY <= 30) wixWindowFrontend.openLightbox('Promo (30% off)')

})

});

1 Like

This code works as expected for me. I would check thatn your page ID is correct and the name of your lightbox. You may want to change the name of the lightbox so there are no spaces.