我的Featherlight画廊需要点击两次才能激活。 你会碰巧知道为什么吗? 这里是我的代码...为什么我的Featherlight画廊需要点击两次才能激活?
的Javascript/jQuery的:
$(".woocommerce-product-gallery").attr({
"data-featherlight-gallery" : "",
"data-featherlight-filter" : "a"
});
HTML:
<div class="woocommerce-product-gallery">
<figure class="product_gallery">
<div data-thumb="THUMBNAIL_image.jpg" class="woocommerce-product-gallery__image"><a href="BIG_image.jpg"><img width="593" height="800" src="MEDIUM_image.jpg" data-src="BIG_image.jpg"></a></div>
<div data-thumb="THUMBNAIL_image2.jpg" class="woocommerce-product-gallery__image"><a href="BIG_image2.jpg"><img width="593" height="800" src="MEDIUM_image2.jpg"></a></div>
<div data-thumb="THUMBNAIL_image3.jpg" class="woocommerce-product-gallery__image"><a href="BIG_image3.jpg"><img width="593" height="800" src="MEDIUM_image3.jpg"></a></div>
</figure>
我无法摆脱的容器,因为它们的一部分Woocommerce插件动态。
下面是示例:http://jadepalacecollective.com/product/shoes-4/ 单击鞋子一次......然后两次。看到?
嗨杰拉尔多。那条确切的线路并没有解决它......但你是在正确的思路上。这是什么结束了工作(通过设置羽毛属性后): $('。woocommerce-product-gallery')。featherlightGallery(); \t \t 我会标记你的答案是正确的。非常感谢! –
这为我修好了! –