Disable link if current image is shown
<p>How can I disable the thumbnail link if the current image is begin shown?</p>

<pre><code>&lt;script type="text/javascript"&gt;
    $(function() {
        $(".image").click(function() {
            var image = $(this).attr("rel");
            $('#image').hide();
            $('#image').fadeIn('slow');
            $('#image').html('&lt;img src="' + image + '"/&gt;');

            return false;
        });
    });
</code></pre>

<h2>    </h2>

<pre><code>&lt;a href="#" rel="&lt;%=  image.photo.url(:small) %&gt;" class="image"&gt;
    &lt;%= image_tag(image.photo.url(:thumb)) if image.photo %&gt;
&lt;/a&gt;
</code></pre>
