У меня есть пользовательская кнопка закрытия внутри всплывающего окна с использованием magnificPopup. Кнопка закрытия работает в FireFox, но не в Chrome или Safari. В Safari я получаю следующее сообщение об ошибке:undefined не является объектом с magnificpopup.close
undefined is not an object (evaluating 'jQuery.magnificPopup.close')
Это мой JS:
jQuery(document).ready(function($) {
setTimeout(function() {
if ($('#cookies-message').length) {
$.magnificPopup.open({
items: {
src: '#cookies-message'
},
type: 'inline'
});
}
}, 1000);
});
jQuery(document).on('click', '.popup-modal-dismiss', function (e) {
//e.preventDefault();
jQuery.magnificPopup.close();
});
<div id="cookies-message" class="cookie-message mfp-hide">
<img src="/wp-content/themes/site/img/cookies.svg">
<p>… but we also use them to give you the best experience on our website, which is full of other healthy solutions</p>
<p><a class="popup-modal-dismiss" href="#">OKIDOKI</a></p>
</div>