Hi Semicolon,
I'd like to implement to my webshop an exit popup that shows up when user plans to leave the page.
I found your .modal-on-load feature (eg in modal-onload-subscribe.html), also found it in the functions.js:
modal: function( element ){
let settings = {
element: element,
default: '.modal-on-load',
file: 'plugins.lightbox.js',
error: 'plugins.lightbox.js: Plugin could not be loaded',
execfn: 'SEMICOLON_modalInit',
pluginfn: () => $().magnificPopup,
trigger: 'pluginLightboxReady',
class: 'has-plugin-lightbox'
};
SEMICOLON.initialize.functions( settings );
},I'm wondering if you had a similar easy-to-implement solution for exit popups, so I could include the modal with similar easy way, with adding a .modal-on-exit class.
If I need to add some code to my footers (instead of functions.js), that's also fine.
Currently I have the following code that triggers the event when user wants to leave the page.
jQuery(document).on('mouseleave', function(e) {
if (e.clientY < 0) {
alert('show modal here');
}
});I didn't update to Canvas 7 yet (still using Canvas 6.6.5) but would be great if you had some ideas how to implement it with JQuery and magnificPopup.
Many Thanks,
A.
