magnific-popup


$.magnificPopup.open() callbacks is not working


$.magnificPopup.open({
items: {
src: $('#cabinet-msg')
},
type:'inline',
midClick: true,
callbacks: {
close: function() {
alert('test');
}
}
});
$.magnificPopup.open({
items: {
src: $('#cabinet-msg2')
},
type:'inline',
midClick: true,
callbacks: {
close: function() {
alert('test2');
}
}
});
How can I solve this? I need to create popups with javascript not using default initialization. It works but only for one instance. How to make it work for more than one instance?
It seems the problem is here:
_checkInstance = function() {
if(!$.magnificPopup.instance) {
mfp = new MagnificPopup();
mfp.init();
$.magnificPopup.instance = mfp;
}
}
But when declared this way:
$('.acb-modal').magnificPopup({
type:'inline',
midClick: true,
callbacks: {
close: function() {
$('#opencallback div.timer').hide();
$('#opencallback #callback_form').show();
$('#acb-msg-box').hide();
}
}
});
it works fine.
I think it works on jquery specific but I am not familiar with it.
I can make it work by adding hidden elements for this, but I want to make it clearly.
Yep, I have find solution for me by parsing jquery object :-)
You can directly redeclare callbacks methods by using this
$.magnificPopup.instance.st.callbacks = {
close: function() {
alert('test3')
}
}
before using $.magnificPopup.open
thanks for help)

Related Links

Magnific Popup - gallery images not displaying
Magnific Popup custom arrow and number
Is it possible to pass data via the post method to magnific popup when ajax loading content?
What is the best way to test if a Magnific Popup is currently “open”
Apply callback to all instances of Magnific Popup?
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”

Categories

HOME
date
oracle11g
routes
google-docs
gis
jgroups
baqend
multiple-records
slick-slider
midi
spring-xd
izpack
etl
correlation
vb.net-2010
circuit
designer
quartz-scheduler
workload-scheduler
foselasticabundle
django-admin
http-status-code-504
clickonce
opencover
telerik-reporting
microsoft-r
facet
kannel
msys2
delicious-api
socialengine
bcd
noraui
perlin-noise
webtest
cloud-code
mapbox-gl
fusionpbx
disassembling
event-driven
android-browser
objectlistview
webdriver-manager
streamreader
mesos-chronos
core-plot
nxlog
user-accounts
dotcover
komodoedit
csound
np-complete
mcafee
ableton-live
httplistener
fody
skobbler-maps
impresspages
websitepanel
react-native-listview
prettytensor
reactive-banana
google-places
intellij-14
iis-arr
ibaction
sailfish-os
census
pretty-print
fscommand
operator-precedence
tt-news
network-interface
cctv
flask-cors
castle
stxxl
quantlib-swig
dir
easy-install
gwt-rpc
padarn
sqlperformance
mt
word-processor
nsmanagedobject
code-cleanup
blackberry-playbook
psi
locate
mysql-error-1005
lang
remember-me
lpeg
fluent-interface
dentrix
castle-monorail

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