magnific-popup


Adding onclose method in magnificPopup (that autoloads on pageload)


We have here a good example of adding onclose functions for magnificPopup.
However, this works when we call magnificPopup with an onclick event. I was wondering how to add onclose functions when magnificPopup autoloads on pageload.
Here is the code:
<?
if (is_array($flashMessage) && count($flashMessage) > 0) {
?>
<script>
$(document).ready(function() {
$.magnificPopup.open({
items: {
src: '#confirmation',
type:'inline'
}
});
});
</script>
<? } ?>
On this, I need to add onclose event with window.location. Thanks for any help.
The same?
$.magnificPopup.open({
items : {
src: '#test-popup',
},
type: 'inline',
callbacks: {
open: function () {
$.magnificPopup.instance.close = function () {
var confirmed = confirm("Are you sure?"+window.location.href);
if (!confirmed) {
return;
}
$.magnificPopup.proto.close.call(this);
};
}
}
});
I guess You had problems with type:'inline' in items object. Working fiddle

Related Links

Close, open new magnific popup window via API
Magnific Popup with html5 video
Magnific Popup Gallery: How can I display a counter in an inline type item?
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=“…”>?

Categories

HOME
sendgrid
deployment
json.net
relay
octobercms
getelementsbytagname
setup-deployment
sqlite3
acquia
webrequest
fancybox-3
windows-azure-storage
quartz-scheduler
serverless-framework
windows-7-x64
oxyplot
nodatime
plunker
kryo
autoconf
jasonette
wkwebview
centos6.5
status
bootstrap-duallistbox
c++-amp
media-queries
windows-dev-center
amazon-kinesis-kpl
fusionpbx
git-merge
serverside-rendering
reportbuilder
squib
particles.js
botbuilder
android-mediaprojection
isbn
flashair
angular-resource
celery-task
boost-preprocessor
jspdf-autotable
objective-c-swift-bridge
probability-density
markojs
fadeout
captivenetwork
bluegiga
goose
maven-tomcat-plugin
jms2
endeca-workbench
t4mvc
atk4
fouc
jqgrid-formatter
rgeo
responsive-images
method-parameters
graph-api-explorer
proj4js
fscommand
xc16
knuth
google-style-guide
websocket4net
onactivityresult
uitouch
reactfx
seaside
coverflow
rabl
android-screen-support
spring-validator
specification-pattern
bitsharp
isnullorempty
coderush
gdata-api
netdna-api
calling-convention
createwindow
sproutcore-2
firefox4
webkit.net
ugc
windows-live-messenger
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