I'm trying to create a page with a few galleries using the Magnific-Popup jQuery plug-in. I different sections contained in div
s with separate ids and a .gallery
class containing the images.
<div id="content_1">
<p>Some content</p>
<div class="gallery">
<a href="img/pic_1"><img src="img/pic_1.jpg"></a>
<a href="img/pic_2"><img src="img/pic_2.jpg"></a>
</div>
</div>
<div id="content_2">
<p>More content</p>
<div class="gallery">
<a href="img/pic_3"><img src="img/pic_3.jpg"></a>
<a href="img/pic_4"><img src="img/pic_4.jpg"></a>
</div>
</div>
To get the galleries to be separate in the popup I initialized the script multiple times for each content section. When I do this, however, after the first content section, there are more images in the gallery popup (twice as much to be exact) than I linked to. I'm new to javascript, so I'm not sure if I'm just missing something obvious.
From the documentation:
Javascript
Hope that helps!