php - Magento 2中的Fotorama画廊和放大镜问题
问题描述
我在 magento 2 中使用 Porto 主题。我在使用 fotorama 放大镜和 fotorama 画廊时卡住了。
放大镜: 在 fotorama 放大镜中,我将鼠标悬停在产品图像上,它显示 2 张图像。无法正确缩放
图库: 在图库中,我第一次想要 5 张图片,然后滚动我将能够在产品详细信息(查看)页面中看到另一张产品图片。
fotorama.js
OPTIONS = {
itemdisp: 5,
nav: 'dots', // 'thumbs' || false
navposition: 'bottom', // 'top'
navwidth: null,
thumbwidth: THUMB_SIZE,
thumbheight: THUMB_SIZE,
thumbmargin: MARGIN,
thumbborderwidth: MARGIN,
allowfullscreen: false, // true || 'native'
transition: 'slide', // 'crossfade' || 'dissolve'
clicktransition: null,
transitionduration: TRANSITION_DURATION,
captions: true,
startindex: 0,
loop: false,
autoplay: false,
stopautoplayontouch: true,
keyboard: false,
arrows: true,
click: true,
swipe: false,
trackpad: false,
shuffle: false,
direction: 'ltr', // 'rtl'
shadows: true,
showcaption: true,
/**
* Set type of thumbnail navigation
*/
navdir: 'horizontal',
/**
* Set configuration to show or hide arrows in thumb navigation
*/
navarrows: true,
/**
* Set type of navigation. Can be thumbs or slides
*/
navtype: 'thumbs'
},
在gallery.phtml中
"options": {
"nav": "<?php /* @escapeNotVerified */ echo $block->getVar("gallery/nav"); ?>",
"itemdisp":"<?php /* @escapeNotVerified */ echo $block->getVar("gallery/itemdisp"); ?>" /*my custom variable*/
在 view.xml 中
<var name="gallery">
<var name="nav">thumbs</var> <!-- Gallery navigation style (false/thumbs/dots) -->
<var name="itemdisp">5</var><!-- My custom variable -->
任何帮助将不胜感激。
谢谢你。
解决方案
推荐阅读
- android - 系统应用程序在供应商分区中读取/写入数据
- javascript - vue.js 分页错误计算
- flutter - flutter create 需要很长时间才能创建项目
- python - 从变量中的线程函数获取结果
- python - Django/Django REST Framework - 内部 API 显示从外部 API 获取的结果并进行过滤
- c# - 通用 xaml 文件未添加到 UWP 类库中的资源中
- python - 带有 python 2.6.6 认证的 SSL 身份验证
- html - 垂直对齐 html 引导行中的文本
- c++ - 根据字符串参数的内容选择模板
- kivy - Kivy:不知道如何在 ScreenManager 中更新“on_size: root.center = win.Window.center”