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.
<?php $_product = $this->getProduct(); $_helper = $this->helper('catalog/output'); ?> <p class="product-image"> <?php $_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" />'; echo $_helper->productAttribute($_product, $_img, 'image'); ?> </p> <div class="more-views"> <h4><?php echo $this->__('Click Images') ?></h4> <ul> <?php foreach ($this->getGalleryImages() as $_image): ?> <li> <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;" > <!-- The below should remain the same as before --> <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()) ?>"/> </a> </li> <?php endforeach; ?> </ul> </div> <?php endif; ?>
以上是关于Magento Gallery图像滚动的主要内容,如果未能解决你的问题,请参考以下文章
Magento 2 - 如何在 Fotorama JS 中替换 webP 图像