Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if page changed before closing #1178

Open
jgoullet opened this issue Mar 16, 2022 · 0 comments
Open

Check if page changed before closing #1178

jgoullet opened this issue Mar 16, 2022 · 0 comments

Comments

@jgoullet
Copy link

Hello,

I try to check if the content in page changed before closing the popup. I'm trying to use onbeforeunload function but with no success.

window.onbeforeunload = function (e) {
$('.magnific-popup')magnificPopup({
callbacks: {
open: function() {
$.magnificPopup.instance.close = function() {
var confirmed = confirm('test');
if(!confirmed) {
return;
}
$.magnificPopup.proto.close.call(this);
}
}

});
}

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant