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 onload calling a url
callbacks not firing when opening a magnific popup from another one
Magnific Popup - taller mfp-bottom-bar causes max image height issue
How to generate a (magnific popup)-gallery without a-tags
Add data to items in Magnific Popup
How to set the divs to make Magnific Popup animations work
how to display map in mobile devices using magnific popup?
Magnific Popup - Counter in Videogallery
how to manually open and close the popup using Magnific-Popup
How to customize arrows and close button?
no closing “X” with inline content
How to prevent close
Magnific-Popup Loading iframe from non-video players URL
Magnific popup - put arrows inside of an image
magnific closeOnContentClick does not work
How can style popup iframe in Magnific Pop-Up?

Categories

HOME
arduino-uno
wso2-am
jdo
wso2
proxy
netbeans
fluentd
google-play
react-virtualized
iot
read-eval-print-loop
android-4.4-kitkat
yahoo-oauth
amortized-analysis
infragistics
dxl
fingerprint
constraint-programming
add
medical
kibana-4
metatrader4
adobe-analytics
izpack
row
handsontable
jsprit
vaadin7
ghc
code-review
lucene.net
nodatime
sylius
wijmo
dynamic-featured-image
status
wpfdatagrid
maxmind
jspm
google-cloud-nl
.net-4.0
jspresso
noraui
column-family
subset-sum
http-referer
y86
nssegmentedcontrol
http-digest
io-redirection
scaffold
occlusion
awt
android-tabhost
checkboxlist
executenonquery
jquery-nestable
boost-multi-index
slickedit
np-complete
dtexec
windows-iot-core-10
akka-cluster
minimization
static-ip-address
passport-google-oauth
azure-virtual-network
asp.net-4.5
make-install
ptrace
srand
r-tree
t4mvc
metaclass
comobject
map-projections
inmobi
facebook-graph-api-v2.4
gwidgets
oxwall
rdtsc
id3v2
aapt
kgdb
concurrent-collections
oracle-warehouse-builder
intentservice
oam
geos
seed
specification-pattern
itmstransporter
frameset
labwindows
hosts-file
online-compilation
qtkit
netdna-api
nsobject
infobox
sortable-tables
.nettiers
rescale
bespin
sef
mtj
nerddinner
signal-handling
document-conversion

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