Hi, I have a page with several lists with 4 thumbnails and 1 main image each. The images are being swapped using a modified version of this.
$(document).ready(function(){
$(".brand-details li a").click(function(){
var largePath = $(this).attr("href");
var largeAlt = $(this).attr("title");
$('.brand-details li').removeClass('current');
$(this).parent('li').addClass('current');
$(this).parent('li').parent('ol').children('.largeImg').children('img').attr({ src: largePath, alt: largeAlt });return false;
});
});
As you can see, a class is removed/added to highlight the current image but when you click on a thumbnail on a separate list it also removes the class from the previous list.
How can I get it to leave the class IF it is a different list. Preferably without needing an ID?
Many thanks