【发布时间】:2014-03-19 18:10:35
【问题描述】:
我正在使用 jquery 脚本在主产品图像框中显示产品缩略图。
jQuery(document).on('mousedown','.thumbnails .zoom', function(){
var photo_fullsize = jQuery(this).find('img').attr('src').replace('-100x100','');
jQuery('.woocommerce-main-image img').attr('src', photo_fullsize);
return false;
});
问题是,如果我点击缩略图,它会在主产品图像框中打开,但也会在灯箱中打开。如何从缩略图链接中删除灯箱?我根本不想要任何链接。我只想要主产品图片框中的灯箱。
我从 product-thumbnails.php 中找到以下代码:
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', sprintf( '<a href="%s" class="%s" title="%s" data-rel="prettyPhoto[product-gallery]">%s</a>', $image_link, $image_class, $image_title, $image ), $attachment_id, $post->ID, $image_class );
但是如何改变它只显示图片而不显示链接呢?
谢谢!
【问题讨论】:
标签: php jquery wordpress woocommerce