in version 3 it was like this:
$("[data-fancybox]").fancybox({
afterClose: function () {
//window.location.reload();
$(".modal-content").removeClass("active");
},
});
How to write the same in version 4?
Fancybox.bind('[data-fancybox]', {
on: {
destroy: function (fancybox, event) {
document.querySelectorAll('.modal-content').forEach(function (content) {
content.classList.remove('active');
});
},
},
});