dimsemenov / Magnific-Popup

Light and responsive lightbox script with focus on performance.
http://dimsemenov.com/plugins/magnific-popup/
MIT License
11.39k stars 3.49k forks source link

Check if MFP is open? #594

Open anteksiler opened 9 years ago

anteksiler commented 9 years ago

I would like to run $.magnificPopup.close(); only if there is a popup open. Is that possible? And can we add callbacks to $.magnificPopup.close() ?

royalwood commented 7 years ago

of course. You could write the cases such as mfp = $.magnificPopup.instance; if(!mfp.isOpen) {...}