Stop animation on last element
<p>I have a sliding panel and on the last element I want the animation to stop i've tried using the .is(':last') and it doesn't stop. here is my code. the current var is set to the first element when the form loads. It animates to the left and keeps animating when you click the next button i just want to stop it on the last element</p>

<pre><code>jQuery('.wikiform .navigation input[name^=Next]').click(function () {
    if (current.is(':last')) return;
        jQuery('.wikiform .wizard').animate({ marginLeft: '-=' + current.width() + "px" }, 750);
        current = current.next();});

&lt;div id="formView1" class="wikiform"&gt;
    &lt;div class="wizard"&gt;

        &lt;div id="view1" class="view"&gt;
            &lt;div class="form"&gt;
                Content 1
            &lt;/div&gt;        
        &lt;/div&gt;
        &lt;div id="view2" class="view"&gt;
            &lt;div class="form"&gt;
                Content 2
            &lt;/div&gt;
        &lt;/div&gt;

    &lt;/div&gt;
    &lt;div class="navigation"&gt;
        &lt;input type="button" name="Back" value=" Back " /&gt;
        &lt;input type="button" name="Next " class="Next" value=" Next " /&gt;
        &lt;input type="button" name="Cancel" value="Cancel" /&gt;
    &lt;/div&gt;   
&lt;/div&gt;
</code></pre>
