Reputation: 4000
When closing Photoswipe, it has some leftover elements on the DOM that breaks it, so I want to use jQuery to reset it every time it's closed. How can I get the event when Photoswipe closed?
Upvotes: 0
Views: 2850
Reputation: 1130
You can use PhotoSwipe events.
// Event fire when Gallery starts closing
pswp.listen('close', function() {
// code here
});
// Even trigers when Gallery unbinds events
// (triggers before closing animation)
pswp.listen('unbindEvents', function() {
// code here
});
// Event fires when only after the gallery is closed and closing animation finished.
pswp.listen('destroy', function() {
// code here
});
Upvotes: 2