Magento Gallery图像滚动

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Magento Gallery图像滚动相关的知识,希望对你有一定的参考价值。

Replace the code below in your templates 'media.phtml' file. This has mouseover and mouseout but can be removed it needed.
  1. <?php
  2. $_product = $this->getProduct();
  3. $_helper = $this->helper('catalog/output');
  4. ?>
  5. <p class="product-image">
  6. <?php
  7. $_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(220).'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" id="main_image" />';
  8. echo $_helper->productAttribute($_product, $_img, 'image');
  9. ?>
  10. </p>
  11. <?php if (count($this->getGalleryImages()) > 0): ?>
  12. <div class="more-views">
  13. <h4><?php echo $this->__('Click Images') ?></h4>
  14. <ul>
  15. <?php foreach ($this->getGalleryImages() as $_image): ?>
  16. <li>
  17.  
  18. <a href="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'main_image', $_image->getFile())->resize(220); ?>" title="<?php echo $_product->getName();?>" onmouseover="this.prevsrc=$('main_image').src; $('main_image').src = this.href;" onmouseout="$('main_image').src=this.prevsrc;" onclick="return false;" >
  19. <!-- The below should remain the same as before -->
  20. <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(56, 56); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"/>
  21.  
  22. </a>
  23.  
  24. </li>
  25. <?php endforeach; ?>
  26. </ul>
  27. </div>
  28. <?php endif; ?>

以上是关于Magento Gallery图像滚动的主要内容,如果未能解决你的问题,请参考以下文章

Magento主产品图像切换器

Magento 2 - 如何在 Fotorama JS 中替换 webP 图像

Magento - 无法在管理员中上传产品图片

UI组件之AdapterView及其子类Gallery画廊控件使用

markdown [magento] - 代码片段

android 如何让gallery自动滚动?