magnific-popup


What is the best way to test if a Magnific Popup is currently “open”


What is the best way to test if a Magnific Popup is currently "open"?
Will a check for the existence of some div be future proof?
For example, if I use:
if ($(".mfp-ready").length > 0)
...
I looked for the equivilent of an isopen property in the api documentation but found nothing like that
EDIT
Following Dmitry's answer, I examined the instance object and found the following properties that may prove useful to others:
isAndroid
isIE7
isIE8
isIOS
isLowIE
$.magnificPopup.instance.isOpen
Here is simple solution from Magnific popup documentation
$('.image-link').on('mfpOpen', function(e /*, params */) {
console.log('Popup opened', $.magnificPopup.instance);
});
Old question, i know, but none of the other answers solved the same issue for me.
The next code solved it for me:
$('.open-popup-link').magnificPopup({
callbacks: {
open: function() {
console.log('text to show in console if popup is open');
}
}
});

Related Links

Magnific-popup - How to prevent “image source” from being displayed when 'data-source' not defined
how to add bullets in Lightbox gallery of magnific pop up?
Magnific popup specific size
Magnific popup scroll issue
Does it only work on wordpress?
Magnific Popup scroll issues with iframe and iOS
How to apply magnific pop to image preview after revoke the object url
How to override magnific popup inline markup
Magnific pop-up only links to you tube
Magnific Popup close button placed in invalid html?
Magnific Popup - Google Maps Embed API must be used in an iframe
Magnific Popup Plugin Not Showing when Previewed in Browser
Magnific Popup Wordpress
Magnific vs PhotoSwipe
How to adjust video size magnific popup
$.magnificPopup.open() callbacks is not working

Categories

HOME
maven
pdf
debugging
mediawiki
path-finding
json.net
appx
session
google-oauth
yarn
frameworks
azure-media-services
bs4
google-translate
kibana-4
metatrader4
collectd
ibm-odm
clojurescript
graphlab
oxyplot
samoa
google-cloud-speech
visual-composer
orleans
ehcache
telerik-reporting
blazemeter
opennlp
xpages-ssjs
preg-match
react-chartjs
gammu
mpmediaquery
wixsharp
jquery-bootgrid
neuroscience
event-driven
android-browser
c11
gzipstream
jvm-languages
outlook-api
businessworks
skeleton-css-boilerplate
auto-update
osx-mavericks
domain-model
darcs
carrot
lift-json
snmptrapd
python-cryptography
arrow-keys
xcb
markojs
simplewebrtc
pagedlist
ready-api
bluegiga
freedesktop.org
reactive-banana
jqgrid-formatter
pundit
tableau-online
twirl
arcanist
iiviewdeckcontroller
dereference
truevault
javax.mail
system.reflection
javafx-webengine
titanium-modules
rdl
document-classification
navigationservice
funcunit
doskey
braille
centos5
spring-io
dataadapter
hungarian-algorithm
interface-orientation
pygit2
hosts-file
ocx
enter
adk
whoosh
window-management
hirefire
netbeans-7.1
krl
filtered-index
nsviewanimation
webkit.net
ti-dsp
phonon

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App