我想设置 fotorama 全屏图像弹出/灯箱的自定义高度和宽度。 如何做到这一点....请帮助。
问问题
47 次
2 回答
0
查看
应用程序/设计/前端/{package}/{theme}/template/catalog/product/view/media.phtml。
如果您的主题与默认主题有某种相似之处,您应该会找到如下内容:
<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>;
于 2021-12-22T01:25:38.503 回答
0
您必须编辑以下文件:
应用程序/设计/供应商/Magento_Catalog/templates/product/view/gallery.phtml
在这里您可以添加您的选项:
<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
}
}
}
}
于 2021-12-17T02:37:49.393 回答