Hello, I want just load a gallery of images from Ajax.
I tried this code:
$('.popup-pic').magnificPopup({
type: 'ajax',
callbacks: {
parseAjax: function (mfpResponse) {
// mfpResponse.data is a "data" object from ajax "success" callback
// for simple HTML file, it will be just String
// You may modify it to change contents of the popup
// For example, to show just #some-element:
// mfpResponse.data = $(mfpResponse.data).find('#some-element');
// mfpResponse.data must be a String or a DOM (jQuery) element
console.log('Ajax content loaded:', mfpResponse);
},
ajaxContentAdded: function () {
// Ajax content is loaded and appended to DOM
console.log(this.content);
}
}
});
And the URL is a URL that loads the list this way:
items
src: path1,
src: path2,
src: path3
That's all, but the only message I get is "TypeError: context is undefined".
Is the plugin prepared for this? if not, you could consider adding this in the future.
Hello, I want just load a gallery of images from Ajax.
I tried this code:
And the URL is a URL that loads the list this way:
That's all, but the only message I get is "TypeError: context is undefined".
Is the plugin prepared for this? if not, you could consider adding this in the future.
Thanks Jaime