I want to open my popup when ajaxCall function is called.
Like this:
function ajaxCall()
{
openPopup();
}
function openPopup()
{
$('.popup-modal').magnificPopup({
type: 'inline',
modal: false,
});
$(document).on('click', '.closePopup', function (e)
{
e.preventDefault();
$.magnificPopup.close();
});
}
Here is the fiddle: http://jsfiddle.net/qweWa/33/
I want this popup to open when ajaxCall function is called.
Here is the working fiddle for onclick button open popup:
http://jsfiddle.net/qweWa/27/
Use the open() function
function openPopup(el) { // get the class name in arguments here
$.magnificPopup.open({
items: {
src: '#thanksModal',
},
type: 'inline'
});
}
JSFiddle : http://jsfiddle.net/t5f5e5zw/2/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With