Simply put I'm using a plugin called magnific popup, which is a lightbox popup, and you can initialise it from a set of options on dom ready:
$.magnificPopup.open({
items: [
{ src: "img-src.jpg" },
{ src: "img-src2.jpg" },
{ src: "img-src3.jpg" },
etc
]
});
I've created an array of images in javascript held within a div which then need to be passed into that list. Only I'm not sure how. Heres what I've got.
var $zoomurl = $('.gallery').find('img').attr('src');
How do I get the contents of var $zoomurl into items options? An explanation of the answer would be of value also!