Просто включите переключатель изображения и обнаружите небольшую проблему:
У меня есть три скрытых изображения, и при наведении курсора на соответствующую миниатюру я хочу добавить класс тока к основному изображению (чтобы оно не было скрыто).
$("#thumbs img").mouseenter(function(){
//this gets the url of the thumb
var imgSrc = $(this).attr("src");
//this removes the last 7 letters
imgSrc = imgSrc.slice(0,-7);
//this adds .jpg to the end
imgSrc = imgSrc + '.jpg';
//This removes all images class of current
$('#mainImg img').removeClass("current");
//I want this to find the image with the src of imgSrc and add the current class
$('#mainImg').find(img.attr("src",imgSrc)).addClass("current");
Последняя строка - проблема, она не работает - какой-нибудь совет?