Hello! On a site I use a plug-in masonry for a portfolio. Tell me how to add the ability to open a photo in an iframe when pressed, for example, i.e. increase it?

Or advise the best plugins for such a thing.

Thank!

    1 answer 1

    I will recommend you the blueimp Gallery , which I use myself, including with Masonry. On the project website (via the link above), go to the "Lightbox image gallery" section, and click on the images.

    The gallery is connected in the standard way , there will be no subtleties with Masonry, since plugins do not conflict with each other.

    1. Connect the blueimp-gallery.js and jquery.blueimp-gallery.js
    2. Wrap each image in Masonry with the data-gallery="mygallery"

    Here is an example of the layout of a single image:

     <a href="yourimage.jpg" data-gallery="mygallery"> <img src="yourimage.jpg"/> </a> 

    All images with the same key ( mygallery in the example) the plugin will show in a single gallery (images can be scrolled in the view mode). If you do not need to scroll through - then set a unique key in the data-gallery for each image.