Bear in mind I'm a javascript/jquery/stackoverflow newbie. I have an array of JQuery objects (each one is an image). Right now I've got a separate function for each item in the array:
var $photos = [];
$photos.push($('img.one'), $('img.two'), $('img.three'), $('img.four'), $('img.five'), $('img.six'));
$('.thumbnails img.two').click(function(){
$('div#slide-container').fadeIn('fast');
setTimeout(function(){
$('div#slideshow').slideDown('fast');}, 200);
setTimeout(function(){
images[1].fadeIn('fast');}, 500);
});
In other words I have the above code for each of the 5 indexes in the array. How can I write this so that I can target whichever photo is clicked using just one function instead of six? So instead of "images[1]" specifically, I can just say "images[i]".
Here's a link to a live version of this: