How to prevent blank image display on mouse hover for products without a second image?

Ankitsridhar
New Member
8 0 0

I am using Brooklyn Theme in Shopify store. I have added mouse hover functionality on all Products. On mouse hover second image is displayed. In couple of products second image is not there so on hover Blank image appears. so what I need on products where second image is missing mouse hover shouldn't show blank image.

I have used this code to display second image.

<img class="hidden" src="{{ product.images[1] | product_img_url: 'large' }}" alt="{{ product.images[1].alt | escape }}" />

But couple of products which does not have second image I need on hover missing image does not get displayed.

Any code to make it work.

Any help appreciated.

Thanks

 

Replies 0 (0)