I want to set custom height and width of fotorama fullscreen image popup/lightbox. How to do that….please help.
2
You have to edit the following file:
app/design/vendor/Magento_Catalog/templates/product/view/gallery.phtml
Here you can add your options:
<script type="text/x-magento-init"> { "[data-gallery-role=gallery-placeholder]": { "mage/gallery/gallery": { "mixins":["magnifier/magnify"], "magnifierOpts": <?php /* @escapeNotVerified */ echo $block->getMagnifier(); ?>, "data": <?php /* @escapeNotVerified */ echo $block->getGalleryImagesJson(); ?>, "options": { "maxheight": "700", // Add your value here } } } }
Check
app/design/frontend/{package}/{theme}/template/catalog/product/view/media.phtml.
If your theme is somehow similar with the default one you should find something like this:
<a href="#" onclick="popWin('<?php echo $this->getGalleryUrl($_image) ?>', 'gallery', 'width=300,height=300,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;"title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"> <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(56); ?>" width="56" height="56" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /> </a>;
Click here to cancel reply.
2
Answers
You have to edit the following file:
Here you can add your options:
Check
If your theme is somehow similar with the default one you should find something like this: