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 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记