Jquery remove class from image

Posted by user1269625 on Stack Overflow See other posts from Stack Overflow or by user1269625
Published on 2012-09-06T21:17:35Z Indexed on 2012/09/06 21:38 UTC
Read the original article Hit count: 153

Filed under:
|

Hey ya'll I have these 3 images thumbnails here...

<div class="wpcart_gallery" style="text-align:center; padding-top:5px;">
<a class="thickbox cboxElement" title="DSC_0118" href="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/DSC_0118.jpg" rel="Teardrop Druzy Amethyst Ring" rev="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/DSC_0118.jpg">
<img class="attachment-gold-thumbnails colorbox-736" width="50" height="50" title="DSC_0118" alt="DSC_0118" src="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/DSC_0118-50x50.jpg">
</a>
<a class="thickbox cboxElement" title="P7230376" href="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/P7230376.jpg" rel="Teardrop Druzy Amethyst Ring" rev="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/P7230376.jpg">
<img class="attachment-gold-thumbnails colorbox-736" width="50" height="50" title="P7230376" alt="P7230376" src="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/P7230376-50x50.jpg">
</a>
<a class="thickbox cboxElement" title="P7230378" href="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/P7230378.jpg" rel="Teardrop Druzy Amethyst Ring" rev="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/P7230378.jpg">
<img class="attachment-gold-thumbnails colorbox-736" width="50" height="50" title="P7230378" alt="P7230378" src="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/P7230378-50x50.jpg">
</a>
</div>

What I am trying to do is come up with a jquery code that would remove the cboxElement from the first image and if I click on one of the images to remove cboxElement and place cboxElement to the other images...

I also have this big image and when you click on one of the thumbnails, the image is replaced by the thumbnail and thats really the thumbnail I want to exclude...Could I possible just say if one of the 3 images src = this one image = src remove the class from this thumbnail?

Which way would be better? I am very new at jquery :(

I hope this makes sense.

Here is the code for the big image...

<a class="preview_link cboxElement" style="text-decoration:none;" href="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/DSC_0118.jpg" rel="Teardrop Druzy Amethyst Ring">
<img id="product_image_736" class="product_image colorbox-736" width="400" src="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/DSC_0118.jpg" title="Teardrop Druzy Amethyst Ring" alt="Teardrop Druzy Amethyst Ring">
<br>
<div style="text-align:center; color:#F39B91;">Click To Enlarge</div>
</a>

Any help or a point in the right direction would be awesome!!

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery