开始按照jack提供的jqlightbox 下载地址下载了一个jqlightbox 1.7 , 在zencart 1.3.9上整整弄了我一个星期都没装好, 始终看不到效果 (坛上里有不少人都是这么反应), 正当我接近崩溃的时候, 无意中搜到了这个链接 http://leandrovieira.com/projects/jquery/lightbox/ , 下载之后, 发现这不是zencart 安装版的, 哈哈哈, 我终于看到了一点点曙光。好家伙, 对它分析了59秒, 开始动工了:
首先备份一下网站文件。
把下载包里面的 js 和 css 文件夹复制到includes/templates/your_template/ 下.
打开inclulde/template/your_template/common/html_header.php, 在</head> 前面加上:
<script type="text/javascript" src="includes/templates/your_template/js/jquery.js"></script>
<script type="text/javascript" src="includes/templates/your_template/js/jquery.lightbox-0.5.js"></script>
<link rel="stylesheet" type="text/css" href="includes/templates/your_template/css/jquery.lightbox-0.5.css" media="screen" />
<!-- / fim dos arquivos utilizados pelo jQuery lightBox plugin -->
<!-- Ativando o jQuery lightBox plugin -->
<script type="text/javascript">
$(function() {
$('#gallery a').lightBox();
});
</script>
(因为1.3.9版本只会自动添加以style开发的css 文件名 和以jscript_ 开头的js 文件名)
再打开include/template/your_template/template/tpl_modules_main_product_image.php
修改
<div id="productMainImage" class="centeredContent back">
<script language="javascript" type="text/javascript"><!--
document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');
//--></script>
为
<div id="gallery" class="centeredContent back">
<?php echo '<a href="'.$products_image_medium.'">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /> </a>'; ?>
哦了, 测试一下 http://www.digimartz.net/index.php?main ... ucts_id=23
over.





News