duanguan3863 2014-05-14 11:07
浏览 45
已采纳

Magento:如何在best-sellers.phtml文件中创建鼠标悬停图像?

In Magento "best-sellers" block, I have fixed images that I want to replace with mouseover images.

Here is the initial code in best-sellers.phtml :

<div>
   <a href="<?php echo $_product->getProductUrl($_product); ?>">
      <img src="<?php echo $_imgHelper->init($_product, 'thumbnail')->resize(220, 276); ?>" width=« 220" height=« 276" alt="<?php echo $_product->getName(); ?>" />
   </a>
</div>

I changed the inital code to this :

<img onmouseover="this.src='http://www.mywebsite/media/wysiwyg/chaise-design-italie-hip_trans-Verso_1.png';             
" onmouseout="this.src="<?php echo $_imgHelper->init($_product, 'thumbnail')->resize(220, 276); ?>" 
" src="<?php echo $_imgHelper->init($_product, 'thumbnail')->resize(220, 276); ?>" 
width=« 220" height=« 276" alt="<?php echo $_product->getName(); ?>" />

The result is : the source image appears, the mouseover image appears BUT nothing happens on mouseout, it keeps showing the mouseover image.

Any idea what I did wrong ?

Many thanks for your help !

  • 写回答

1条回答 默认 最新

  • duanjian7343 2014-05-14 12:14
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 gwas 分析-数据质控之过滤稀有突变中出现的问题
  • ¥15 没有注册类 (异常来自 HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
  • ¥15 知识蒸馏实战博客问题
  • ¥15 用PLC设计纸袋糊底机送料系统
  • ¥15 simulink仿真中dtc控制永磁同步电机如何控制开关频率
  • ¥15 用C语言输入方程怎么
  • ¥15 网站显示不安全连接问题
  • ¥15 51单片机显示器问题
  • ¥20 关于#qt#的问题:Qt代码的移植问题
  • ¥50 求图像处理的matlab方案