Shiva Bhusal
Shiva's Blog

Follow

Shiva's Blog

Follow

Custom Close button : Magnific Popups jQuery

Shiva Bhusal's photo
Shiva Bhusal
·Sep 30, 2014·

1 min read

Play this article

We can close magnific popup in various ways

We 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_opend_popup').magnificPopup('close');
 });
 
Share this