I need to add a lightbox functionality for zooming single images in blocks. I thought to use magento 2 fotorama lightbox that's used for the product gallery. I would show the block in the product page so the js library would be already loaded. Any advice or help? I don't know how to make it.
Thanks a lot.
Magento – magento 2 fotorama lightbox on single image
fotoramamagento2
Best Answer
Magento 2 offers a lot of jQuery Widgets out of the box. Magnifier Widget would solve your solution. High level implementation is as follows:
You can use this code in any template file. Hope this helps.
EDIT : this method does not work due to its dependent on the fotorama gallery, here is a jQuery Fancybox alternative
file: app/code/design/frontend/Vendor/Package/Magento_Theme/layout/default.xml
Then add this markup to your template file, replacing your images, respectively.
Fancy Box docs