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 .gal
From the documentation:
To have multiple galleries on a page, you need to create a new instance of Magnific Popup for each seperate gallery. For example
<div class="gallery"> <a href="path-to-image.jpg">Open image 1 (gallery #1)</a> <a href="path-to-image.jpg">Open image 2 (gallery #1)</a> </div> <div class="gallery"> <a href="path-to-image.jpg">Open image 1 (gallery #2)</a> <a href="path-to-image.jpg">Open image 2 (gallery #2)</a> <a href="http://vimeo.com/123123" class="mfp-iframe">Open video (gallery #2). Class mfp-iframe forces "iframe" content type on this item.</a> </div>
Javascript
$('.gallery').each(function() { // the containers for all your galleries $(this).magnificPopup({ delegate: 'a', // the selector for gallery item type: 'image', gallery: { enabled:true } }); });
Hope that helps!