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:
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/