 <h2><a href="http://jsfiddle.net/adriancarriger/t8Lyarmc/10/" rel="nofollow">Working Fiddle</a></h2> <p>It looks like you're not selecting the current slide's image. I found the current slide by looping through the slides and checking their opacity.</p> <h2>Remove this</h2> <pre><code>var sr = $(this).attr('src'); </code></pre> <h2>Replace with this</h2> <pre><code>var sr; $(this).closest('.slides').find('.slide-container').each(function(index) { if ($(this).find('.slide').css("opacity") === 1) { sr = $(this).find('img').attr('src'); } }); </code></pre>