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 show background image while loading fullres image
Popup - It should load an .aspx page
Modal dialog. - Confusing
Toggle verticalFit on an open image?
Does Magnific Popup support custom events/buttons
I can't get the overflowY option to work in magnific popup
magnific popup group do not working
Magnific-popup: how to get image url from <img src=“…”>?
Styling magnific-popup arrows
magnific popup modal closes on click
Magnific popup: getting “The image could not be loaded”
How to give a fixed size to image in magnific-popup pluggin
magnific popup Inline Lightbox Gallery how to specify item in array from html link
how to make browser back close magnific-popup
Simple Magnific Popup Gallery not working
Magnific Popup onload calling a url

Categories

HOME
testng
listview
webpack
gis
razor
sqlite3
c#-2.0
wamp
autotools
session-variables
postgres-xl
resize
decimal
foselasticabundle
transformation
ab-testing
firefox-webextensions
textfield
scriptcs
opencover
arabic
mps
sylius
dcevm
kudan
numerical-methods
xacml
msys2
windows-server-2000
windowbuilder
flink-streaming
directx-10
javascriptcore
iframe-resizer
ecto
phonegap
column-family
openoffice.org
xmlreader
dosbox
multilingual
gesture
abstract-class
streamsets
android-tabhost
mapzen
core-plot
texmaker
wso2carbon
google-datalayer
zip4j
logparser
pebble-watch
colorama
nativeapplication
directory-structure
sqlclient
lift-json
typed-lambda-calculus
smart-table
word-vba-mac
medium.com
deadbolt-2
instant
mikroc
nsfilemanager
ctest
paypal-express
superstack
qgraphicsview
cloudbees
photobucket
natvis
thredds
jmeter-maven-plugin
simple-framework
wordml
purge
libressl
coveralls
tarjans-algorithm
rgeo
varargs
browser-bugs
drawbitmap
riak-cs
microbenchmark
key-management
csquery
website-monitoring
pick
gadt
p4java
jquery-layout
mechanize-ruby
typo3-neos
uv-mapping
dir
angularjs-controller
e4x
libstdc++
mt
cascalog
armcc
parametric-equations
spring-portlet-mvc
gwt-ext
xmlspy
locate
xfbml
fluent-interface
nhibernate.search
dbal
avatar
temporal-database
port-number
3gp

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