http://www.wargame-club.com/3-day-molle-assault-backpack-black.html
当我点击大产品图像下的四个产品缩略图时,产品图像会发生变化。我发现a
标签上没有click
函数。它是如何使缩略图上的产品图像发生变化的?非常感谢。
<li>
<a title="" class="cloud-zoom-gallery" rel="popupWin:'http://www.wargame-club.com/catalog/product/gallery/id/24/image/83/', useZoom: 'cloudZoom', smallImage: 'http://www.wargame-club.com/media/catalog/product/cache/6/image/265x265/fa17b1d835a4c57a29916eae7df1805d/A/S/AS043_2.jpg'" href="http://www.wargame-club.com/media/catalog/product/cache/6/image/fa17b1d835a4c57a29916eae7df1805d/A/S/AS043_2.jpg"></a>
</li>
当您检查页面并检查javascript文件时,您将进入:http://www.wargame-club.com/js/cjm/colorselectorplus/cloud-zoom.1.0.2.min.js
在这个文件中,你会发现以下代码:
$(this).bind('click', $(this), function (event) {
var data = event.data.data('relOpts');
// Destroy the previous zoom
$('#' + data.useZoom).data('zoom').destroy();
// Change the biglink to point to the new big image.
$('#' + data.useZoom).attr('href', event.data.attr('href'));
// Change the small image to point to the new small image.
$('#' + data.useZoom + ' img').attr('src', event.data.data('relOpts').smallImage);
// Init a new zoom with the new images.
$('#' + event.data.data('relOpts').useZoom).CloudZoom();
}
使用的脚本是:http://www.starplugins.com/cloudzoom