How to close popup window with a content button?
Hello!
I need an advise very much from you: I use popup window as a modal, when opening the page with concrete ID.
It is working very good. But I need to close popup not with a Close button x, but with my content button withing modal content.
Because there is an agreement and "I Agree" button should be there.
THE QUESTION - how to close popup modal? I tried a huge quantity of codes in onclick, jQuery and so on. Nothing helps... I can't copy function from class mfp-close. All work very good except additional button which must close modal, but does not do that...
Any advise?
Comments
if ( is_page( array( 146, 2045 ) ) ) {
?>
<script type='text/javascript'>
jQuery(document).ready(function($) {
$(function(){
$('div.ino-popup-win a.popup-link').click();
});
});
</script>
<?php
}
}
add_action('wp_head', 'is_catalogue');
jQuery(document).ready(function($) {
$(function(){
$('div.ino-popup-win a.popup-link').click();
});
});
</script>
jQuery.magnificPopup.proto.close.call(this);
});