Jquery Image Gallery Next Button
<p>Can't seem to get this jquery gallery working. I've been able to get the .galleryImgs click function working, but cant seem to get the #gallery-next click function to work. It's supposed to get the data-src attribute from the next .galleryImgs div and set it in the .galleryImg src. I've tried using addClass and removeClass so it's known which to start from but still wont work. All help appreciated.</p>

<pre><code>&lt;img class="galleryImgs" data-src="images/test-image-1.jpg" src="images/test-image-1-s.jpg" /&gt;
&lt;img class="galleryImgs" data-src="images/test-image-2.jpg" src="images/test-image-2-s.jpg" /&gt;
&lt;img class="galleryImgs" data-src="images/test-image-3.jpg" src="images/test-image-3-s.jpg" /&gt;
&lt;img class="galleryImgs" data-src="images/test-image-4.jpg" src="images/test-image-4-s.jpg" /&gt;
&lt;img class="galleryImgs" data-src="images/test-image-5.jpg" src="images/test-image-5-s.jpg" /&gt;

&lt;img class="galleryImg" src="" /&gt;

&lt;div id="gallery-next"&gt;&lt;/div&gt;

&lt;script type="text/javascript"&gt;
$(function(){
    $('.galleryImgs').click(function(){
        $('.gallery').show();
        $(this).addClass('catherine');
        var $galleryImg = $(this).attr("data-src");
        $('.galleryImg').fadeIn().attr("src", $galleryImg);
    });
    $('#gallery-next').click(function(){            
        $('.galleryImgs').hasClass('catherine').removeClass('catherine').next('.galleryImgs').addClass('catherine');
        var $galleryImg = $('.galleryImgs').hasClass('catherine').attr("data-src");
        $('.galleryImg').attr("src", $galleryImg);
    });
});
&lt;/script&gt;
</code></pre>
