Ad

How To Give Border To To Current Displaying Border

- 1 answer

I am using Shopify envy theme. I have multiple product images. I want to give border to thumb image which image is displaying as main image. In short the current image should have border.

Here is the example image what I want :enter image description here

Small images are multiple different thumb image. If thumb image is displaying in main big image that thumb should have border.

This is my jQuery:

$('a.image-swap').click(function() {
    var newImage = $(this).attr('href');
    $('.featured-image-div img').attr({ src: newImage });
    return false;
});
Ad

Answer

According to your code try this:

$('a.image-swap').click(function() {
var newImage = $(this).attr('href');
$( '.featured-image-div img' ).attr({ src: newImage });
$('a.image-swap').removeClass('active');
$(this).addClass('active');
return false;

Hope will work... :)

Ad
source: stackoverflow.com
Ad