Passing arguments to functions
<p>I don't see anything wrong with this code, but it's not working as expected.</p>

<pre><code>function slide(slideIndex, slideDirection) {
    console.log(slideDirection); // outputs 'right'
    $('.slide').animate({slideDirection: '-=940'}, 400);
}    

$(function(){
    $('.prev','.slide').click(function (e) {
        e.preventDefault();

        var slideIndex = $(this).closest('.slide').index(),
            slideDirection = 'right';

    slide(slideIndex, slideDirection);
    });
});
</code></pre>

<p>If I use just the string 'right' in the animate method, it works. What am I doing wrong?</p>
