在Magento产品页面的使用jqZoom
- <?
xml version="1.0"?>
- <config>
- <modules>
- <MagentoBoy_Jqzoom>
- <active>true</active>
- <codePool>local</codePool>
- </MagentoBoy_Jqzoom>
- </modules>
- </config>
- <?xml version="1.0"?>
- <config>
- <modules>
- <MagentoBoy_Jqzoom>
- <version>0.1.0</version>
- </MagentoBoy_Jqzoom>
- </modules>
- </config>
- <?xml version="1.0"?>
- <layout>
- <catalog_product_view>
- <reference name="head">
- <action method="addItem"><type>js</type><name>jqzoom/js/jquery.jqzoom-core.js</name></action>
- <action method="addItem"><type>js_css</type><name>jqzoom/css/jquery.jqzoom.css</name></action>
- </reference>
- <reference name="product.info.media">
- <action method="setTemplate"><template>jqzoom/media.phtml</template></action>
- </reference>
- </catalog_product_view>
- <review_product_list>
- <reference name="head">
- <action method="addItem"><type>js</type><name>jqzoom/js/jquery.jqzoom-core.js</name></action>
- <action method="addItem"><type>js_css</type><name>jqzoom/css/jquery.jqzoom.css</name></action>
- </reference>
- <reference name="product.info.media">
- <action method="setTemplate"><template>jqzoom/media.phtml</template></action>
- <action method="disableGallery"/>
- </reference>
- </review_product_list>
- </layout>
- <config>
- <frontend>
- <layout>
- <updates>
- <jqzoom>
- <file>jqzoom.xml</file>
- </jqzoom>
- </updates>
- </layout>
- </frontend>
- </config>
- <?
php
- $_product = $this->getProduct();
- $_helper = $this->helper('catalog/output');
- ?>
- <?php if ($_product->getImage() != 'no_selection' && $_product->getImage()): ?>
- <p class="product-image">
- <a href="<?php
echo $this->helper('catalog/image')->init($_product, 'image');?>" class="jqzoom" rel="gal1" title="<?php
echo $this->htmlEscape($this->getImageLabel());?>"> - <img id="image" src="<?
php
echo Mage::helper('catalog/image')->init($_product, 'thumbnail')->resize(265);?>" alt="<?php
echo $this->htmlEscape($this->getImageLabel());?>" title="<?php echo
$this->htmlEscape($this->getImageLabel());?>" style="width:265px;" /> - </a>
- </p>
- <p class="zoom-notice" id="track_hint"><?php echo $this->__('Hover
on image to zoom in the picture') ?></p> - <?php else: ?>
- <p class="product-image">
- <?php
- $_img = '<img
src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(265).'"
alt="'.$this->htmlEscape($this->getImageLabel()).'"
title="'.$this->htmlEscape($this->getImageLabel()).'"
/>'; - echo $_helper->productAttribute($_product, $_img, 'image');
- ?
>
- </p>
- <?
php endif; ?>
- <?
php if (count($this->getGalleryImages()) > 0): ?
>
- <div class="more-views">
- <h2><?php echo $this->__('More
Views') ?></h2>
- <ul>
- <li>
- <a class="zoomThumbActive" href="javascript:void(0);" rel="{gallery:'gal1',
smallimage:'<?php echo Mage::helper('catalog/image')->init($_product, 'thumbnail')->resize(265);?>', largeimage:'<?php echo $this->helper('catalog/image')->init($_product, 'image');?>'}" title="<?php
echo $this->htmlEscape($this->getImageLabel());?>"><img src="<?php
echo Mage::helper('catalog/image')->init($_product, 'thumbnail')->resize(56);?>" width="56" height="56" alt="<?php
echo $this->htmlEscape($this->getImageLabel());?>" /></a> - </li>
- <?php foreach ($this->getGalleryImages() as $_image): ?
>
- <li>
- <a href="javascript:void(0);" rel="{gallery:'gal1',
smallimage:'<?php echo Mage::helper('catalog/image')->init($_product, 'thumbnail', $_image->getFile())->resize(265);?>', largeimage:'<?php echo $this->helper('catalog/image')->init($_product, 'image', $_image->getFile());?>'}" title="<?php
echo $this->htmlEscape($this->getImageLabel());?>"><img src="<?php
echo Mage::helper('catalog/image')->init($_product, 'thumbnail', $_image->getFile())->resize(56);?>" width="56" height="56" alt="<?php
echo $this->htmlEscape($this->getImageLabel());?>" /></a> - </li>
- <?php endforeach; ?
>
- </ul>
- </div>
- <?
php endif; ?
>
- <script type="text/javascript">
- //<![CDATA[
- var $j = jQuery.noConflict();
- $j(document).ready(function(){
- $j('.jqzoom').jqzoom({
- 'zoomWidth' : 300,
- 'zoomHeight' : 300,
- 'xOffset' : 10,
- 'yOffset' : 0,
- 'position' : 'right',
- 'preloadImages' : true,
- 'preloadText' : 'Loading zoom',
- 'title' : true,
- 'lens' : true,
- 'imageOpacity' : '0.4',
- 'showEffect' : 'show',
- 'hideEffect' : 'hide',
- 'fadeinSpeed' : 'slow',
- 'fadeoutSpeed' : '2000'
- });
- });
- //]]>
- </script>
版权声明:本文博客原创文章。博客,未经同意,不得转载。
在Magento产品页面的使用jqZoom的更多相关文章
- Magento给新产品页面添加分页
本文介绍如何让magento创建一个带分页功能的新到产品页面,方便我们在首页或者其它CMS Page调用和展示新到产品. 在Magento我们经常有的做法是建立一个可以调用新产品的block,然后通过 ...
- 如何给magento的产品页面添加返回按钮
如何给magento的产品页面添加返回按钮,最模板提供教程 第一步: 打开 E:\xampp\htdocs\magento\skin\frontend\default\bluescale\css\st ...
- 如何修改magento产品详细页面的栏目
magento默认模板里面的产品信息页面的布局是以两栏带右侧栏显示的,那么如何修改为两栏带左侧栏或者三栏.一栏的方式显示呢?下面教大家一种很简单的方法就可以实现.下面是默认的布局预览:
- 如何实现Magento产品批量导入?
从事外贸的我们在工作中,经常需要添加成千上万个的产品,如果一个一个的去上传,要花费很多时间,有是很让人头痛,那么应该如何实现产品批量上传?如果使用的是Magento系统的话,那么你现在有福利了,因为M ...
- Magento产品批量导入方法?
从事外贸的我们在工作中,经常需要添加成千上万个的产品,如果一个一个的去上传,要花费很多时间,有是很让人头痛,那么应该如何实现产品批量上传?如果使用的是Magento系统的话,那么你现在有福利了,因为M ...
- magento产品批量导出导入
magento产品批量导出导入 博客分类: WP / Joomla! / Magento / Shopify / Drupal / Moodle / Zimbra ExcelMobile配置管理XML ...
- magento产品成功添加到购物车后跳转到不同页面 添加 add to cart 按钮
1 添加产品到购物车成功后是跳转到购物车页面或不跳转.这个在后台可以设置 system -> configuration -> After Adding a Product Redirec ...
- 如何修改magento分类页面的产品的显示个数
经常的有客户问,怎么修改分类页面的产品的个数 这个是magneto后台操作的设置问题 打开后台,在英文状态下: system-->configuration 进入后,点击catalog Prod ...
- magento 获得当前产品页面的产品id
$product_id = Mage::registry('current_product')->getId();
随机推荐
- android:强大的图像下载和缓存库Picasso
1.Picasso一个简短的引论 Picasso它是Square该公司生产的一个强大的图像下载并缓存画廊.官方网站:http://square.github.io/picasso/ 仅仅须要一句代码就 ...
- POJ1274_The Perfect Stall(二部图最大匹配)
解决报告 http://blog.csdn.net/juncoder/article/details/38136193 id=1274">题目传送门 题意: n头m个机器,求最大匹配. ...
- ACdreamoj1110(多重背包)
意甲冠军:多个裸露的双肩背包.水的问题. 解决方法:然背包一样,仅仅只是加一个数组,记录着每一个物品用过的次数,多于存储量时就pass不更新. 另一种方法是将每一个物品用二进制压缩处理.第一个代码比較 ...
- javascript 模块化编程 1
var myModule=(function(){ var models={}; function define(name,deps,cb){ var tk=[]; for(var i=0,l=dep ...
- 移动端 微信 网易 触屏滑动回弹菜单(css版)
总结一下: 有点:网易新闻,微信 热文 都是 -webkit-overflow-scrolling: touch;实现,css实现,轻巧: bug: 部分安卓浏览器(uc,自带) 只支持持续滑动,不 ...
- JavaScript之二:this
在JavaScript中,this的指代对象是什么?最精辟的解释却只有一句话: when a function of an object was called, the object will be ...
- linux sdio card睡眠治疗 sdio card removed解决方案
近期调试几款sdio card suspend时都会出现sdio card removed,之后 要么死机要么模块不能正常工作.根本原因也就是休眠没有处理好.昨天最终找到了 解决方法. 1:host端 ...
- 为网站添加IE6升级提示
原文 为网站添加IE6升级提示 IE6的是一款横跨十年的浏览器,作为一枚前端,对其已经失望透顶,但其在中国的市场比仍旧很高,中国大量的PC上安装的都是盗版Windows XP,而Windows XP上 ...
- Codeforces 450 C. Jzzhu and Chocolate
//area=(n*m)/ ((x+1)*(k-x+1)) //1: x==0; //2: x=n-1 //3: x=m-1 # include <stdio.h> long long m ...
- ZOJ-3652-Maze(BFS)
Celica is a brave person and believer of a God in the bright side. He always fights against the mons ...