[摘要]EC商品的相册成果很好,但是要切换到大相册才气瞥见缩略的大图,所以找了一些改变这个相册的文章,写出来和各人分享!
EC商品的相册成果很好,但是要切换到大相册才气瞥见缩略的大图,所以找了一些改变这个相册的文章、写出来和各人分享!
第一步、用编辑器打开商品详情页模板文件-----goods.dwt,在<head></head>之间添加以下代码:
<script type="text/javascript"> function change_img(img_src) { document.getElementsByName("goods_img")[0].src=img_src; } </script>然后定位到:(我在实际操纵中这步省略了也可实现结果)
<img src=http://down.chinaz.com/"{$goods.goods_img}" alt="{$goods.goods_name|escape:html}" >把它修改为:
<img src=http://down.chinaz.com/"{$goods.goods_img}" alt="{$goods.goods_name|escape:html}" name="goods_img" width="250" height="250"/>第二步、用编辑器打开商品相册库文件-----goods_gallery.lbi 找到
<!-- {foreach from=$pictures item=picture}--> <li><a href=http://down.chinaz.com/"gallery.php?id={$id}&img={$picture.img_id}" target="_blank"><img src=http://down.chinaz.com/"{if $picture.thumb_url}{$picture.thumb_url}{else}{$picture.img_url}{/if}" alt="{$goods.goods_name}" class="B_blue" /></a> </li> <!--{/foreach}-->改为:
<!-- {foreach from=$pictures item=picture}--> <li><a href=http://down.chinaz.com/"gallery.php?id={$id}&img={$picture.img_id}" target="_blank"><img src=http://down.chinaz.com/"{if $picture.thumb_url}{$picture.img_url}{else}{$picture.img_url}{/if}" alt="{$goods.goods_name}" class="B_blue" onmouseOver="change_img(this.src)" /></a></li> <!--{/foreach}-->ECShop下载:
ECShop GBK v2.7.3 Release 1106下载
界面预览本文转自:
分享到