我想設定 fotorama 全屏影像彈出視窗/燈箱的自定義高度和寬度。 如何做到這一點....請幫忙。

uj5u.com熱心網友回復:
您必須編輯以下檔案:
應用程式/設計/供應商/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
}
}
}
}
uj5u.com熱心網友回復:
查看
app/design/frontend/{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>;
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/397636.html
標籤:javascript 马恩托 magento2 照片 magento2.4
下一篇:vue中如何動態渲染html
