1. Solution
Methods below don't have shorthand like "open" and "close".
They should be called through "instance" object.
"instance" is available only when at least one popup was opened.
For example: $.magnificPopup.instance.doSomething();
here example of customized close for magnificPopup
// save magnificPopup instance in variable
var magnificPopup = $.magnificPopup.instance;
//open magnific instance
$.magnificPopup.open({
items: {
src: 'someimage.jpg'
},
type: 'image'
}, 0);
// Close popup that is currently opened
magnificPopup.close();
// Navigation when gallery is enabled
magnificPopup.next(); // go to next item
magnificPopup.prev(); // go to prev item
magnificPopup.goTo(4); // go to item #4
// updates the popup content. Useful after you change "items"
magnificPopup.updateItemHTML();
2. Solution
you can add a button within the popup and assign a function on click event like:
$('#close-button-verify').click(function(){
//This will close the most recently popped dialog
//This method specially works for auto popped dialogs i.e.
//Popup you opened using $.magnificPopup.open()
$.magnificPopup.close();
});
If popup is triggered via onClick event then the same jQuery Object can be used to close that popup
$('#close-button-verify').click(function(){
$('#id_of_button_that_opened_magnificpopup').magnificPopup('close');
});
good luck :)