custom method in jquery
<p>I got this code from Jquery in Action:</p>

<pre><code>$.fn.photoslide = function(options) {
            var settings = $.extend({
                photoElement:'img.photoslidePhoto',
                transformer:function(name) {
                    return name.replace(/thumbnail/,'photo');
                },
                nextControl:null,
                previousControl:null,
                firstControl:null,
                lastControl:null,
                playControl:null,
                delay:3000
            },options||{});
$(settings.previousControl)
        .click(function() {
             showPhoto((settings.thumbnails$.length + settings.current - 1) 
                       % settings.thumbnails$.length);
                }); //Why not just use settings.current - 1??
</code></pre>

<p>the code is meant to be used with a slider. The slider has a button that displays the previous photo.
This is the code for the <code>showPhoto()</code> function:</p>

<pre><code>function showPhoto(index) {
                $(settings.photoElement).attr('src',settings.transformer(settings.thumbnails$[index].src));
                settings.current = index;
            };

            settings.thumbnail$
                .each(function(n) {
                $(this).data('photo-index',n);
                })
                .click(function() {
                    showPhoto($(this).data('photo-index'));
                }); 
</code></pre>

<p>My question is, why can't the <code>index</code> argument for <code>showPhoto()</code> in the click event for <code>$(settings.previousControl)</code> be defined simply as <code>settings.current - 1</code>?</p>

<p>I know this is a long post, but I would appreciate it very much if someone could help me understand this.</p>
